home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-10 | 94.1 KB | 3,130 lines |
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/docs/smb.conf.5 samba-1.9.16alpha10/docs/smb.conf.5
- --- samba-1.9.16alpha9/docs/smb.conf.5 Thu Jun 6 21:57:16 1996
- +++ samba-1.9.16alpha10/docs/smb.conf.5 Mon Jun 10 15:18:35 1996
- @@ -1419,6 +1419,28 @@
- .B Example:
- mangling char = ^
-
- +.SS max disk size (G)
- +This option allows you to put an upper limit on the apparent size of
- +disks. If you set this option to 100 then all shares will appear to be
- +not larger than 100 MB in size.
- +
- +Note that this option does not limit the amount of data you can put on
- +the disk. In the above case you could still store much more than 100
- +MB on the disk, but if a client ever asks for the amount of free disk
- +space or the total disk size then the result will be bounded by the
- +amount specified in "max disk size".
- +
- +This option is primarily useful to work around bugs in some pieces of
- +software that can't handle very large disks, particularly disks over
- +1GB in size.
- +
- +A "max disk size" of 0 means no limit.
- +
- +.B Default:
- + max disk size = 0
- +
- +.B Example:
- + max disk size = 1000
- .SS max log size (G)
-
- This option (an integer in kilobytes) specifies the max size the log
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/Makefile samba-1.9.16alpha10/source/Makefile
- --- samba-1.9.16alpha9/source/Makefile Fri Jun 7 15:36:52 1996
- +++ samba-1.9.16alpha10/source/Makefile Mon Jun 10 15:18:47 1996
- @@ -497,7 +497,7 @@
-
- UTILOBJ1 = util.o system.o charset.o kanji.o fault.o smbencrypt.o charcnv.o
- UTILOBJ2 = $(UTILOBJ1) md4.o loadparm.o params.o pcap.o username.o time.o
- -UTILOBJ = $(UTILOBJ2) interface.o
- +UTILOBJ = $(UTILOBJ2) interface.o replace.o
- PARAMOBJ = $(UTILOBJ) ufc.o smbpass.o access.o
- SMBDOBJ1 = $(PARAMOBJ) trans2.o message.o dir.o printing.o locking.o
- SMBDOBJ2 = ipc.o reply.o mangle.o chgpasswd.o password.o quotas.o uid.o
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/access.c samba-1.9.16alpha10/source/access.c
- --- samba-1.9.16alpha9/source/access.c Sat May 4 17:50:23 1996
- +++ samba-1.9.16alpha10/source/access.c Mon Jun 10 15:18:48 1996
- @@ -9,7 +9,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- #define ALLOW_PURE_ADDRESSES
-
- @@ -37,14 +36,11 @@
- #define FAIL (-1)
-
- /* Forward declarations. */
- -BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client);
- static int list_match(char *list,char *item, int (*match_fn)());
- static int client_match(char *tok,char *item);
- static int string_match(char *tok,char *s);
- static int masked_match(char *tok, char *slash, char *s);
- static int matchname(char *remotehost,struct in_addr addr);
- -BOOL fromhost(int sock,struct from_host *f);
- -
-
- /* Size of logical line buffer. */
- #define BUFLEN 2048
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/chgpasswd.c samba-1.9.16alpha10/source/chgpasswd.c
- --- samba-1.9.16alpha9/source/chgpasswd.c Sat May 4 17:50:23 1996
- +++ samba-1.9.16alpha10/source/chgpasswd.c Mon Jun 10 15:18:48 1996
- @@ -27,7 +27,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int DEBUGLEVEL;
-
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/client.c samba-1.9.16alpha10/source/client.c
- --- samba-1.9.16alpha9/source/client.c Thu Jun 6 21:57:20 1996
- +++ samba-1.9.16alpha10/source/client.c Mon Jun 10 15:18:49 1996
- @@ -3694,10 +3694,6 @@
- }
-
-
- -
- -
- -void cmd_help();
- -
- /* This defines the commands supported by this client */
- struct
- {
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/clitar.c samba-1.9.16alpha10/source/clitar.c
- --- samba-1.9.16alpha9/source/clitar.c Wed Jun 5 01:16:26 1996
- +++ samba-1.9.16alpha10/source/clitar.c Mon Jun 10 15:18:50 1996
- @@ -75,10 +75,7 @@
- static void dotareof();
- static void initarbuf();
- static int do_setrattr();
- -void cmd_tar();
- -int process_tar();
- -char **toktocliplist();
- -int clipfind();
- +
- /* restore functions */
- static long readtarheader();
- static long unoct();
- @@ -1486,7 +1483,7 @@
- return;
- }
-
- -DEBUG(2, ("\nperm set %d %d\n", attra[ATTRSET], attra[ATTRRESET]));
- + DEBUG(2, ("\nperm set %d %d\n", attra[ATTRSET], attra[ATTRRESET]));
- (void) do_setrattr(fname, attra[ATTRSET], ATTRSET);
- (void) do_setrattr(fname, attra[ATTRRESET], ATTRRESET);
- }
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/cvs.log samba-1.9.16alpha10/source/cvs.log
- --- samba-1.9.16alpha9/source/cvs.log Sat Jun 8 15:41:17 1996
- +++ samba-1.9.16alpha10/source/cvs.log Mon Jun 10 15:21:07 1996
- @@ -1459,3 +1459,118 @@
- Log Message:
- preparing for release of 1.9.16alpha9
-
- +
- +****************************************
- +Date: Monday June 10, 1996 @ 13:37
- +Author: tridge
- +
- +Update of /data/cvs/samba/source
- +In directory arvidsjaur:/var/tmp/cvs-serv1310
- +
- +Modified Files:
- + nameannounce.c namedb.c nameelect.c nameserv.h namework.c
- + nmbd.c nmbsync.c
- +Log Message:
- +updates from Luke to rename "domains" more accurately to "subnets"
- +
- +
- +
- +****************************************
- +Date: Monday June 10, 1996 @ 13:39
- +Author: tridge
- +
- +Update of /data/cvs/samba/source
- +In directory arvidsjaur:/var/tmp/cvs-serv1374
- +
- +Modified Files:
- + Makefile locking.c proto.h util.c
- +Added Files:
- + replace.c
- +Log Message:
- +moved some more locking routines to locking.c, and moved replacement
- +routines for broken OSes from util.c to replace.c.
- +
- +
- +
- +
- +
- +****************************************
- +Date: Monday June 10, 1996 @ 13:41
- +Author: tridge
- +
- +Update of /data/cvs/samba/docs
- +In directory arvidsjaur:/var/tmp/cvs-serv1462
- +
- +Modified Files:
- + smb.conf.5
- +Log Message:
- +documented the "max disk size" option.
- +
- +I'm sure I've done this before, we must have lost some patches a while
- +ago?
- +
- +
- +
- +
- +
- +****************************************
- +Date: Monday June 10, 1996 @ 14:38
- +Author: tridge
- +
- +Update of /data/cvs/samba/source
- +In directory arvidsjaur:/var/tmp/cvs-serv1863
- +
- +Modified Files:
- + access.c chgpasswd.c client.c clitar.c dir.c interface.c ipc.c
- + loadparm.c locking.c mangle.c message.c mkproto.awk
- + nameannounce.c namedb.c nameelect.c nameresp.c nameserv.c
- + namework.c nmbd.c nmblib.c nmbsync.c params.c password.c
- + pcap.c predict.c printing.c proto.h quotas.c reply.c server.c
- + smb.h smbencrypt.c smbpass.c status.c testparm.c testprns.c
- + trans2.c ufc.c uid.c username.c util.c
- +Removed Files:
- + loadparm.h localnet.h params.h pcap.h reply.h smbpass.h
- +Log Message:
- +got rid of a lot of redundent header files as we now globally generate
- +prototypes automatically using "make proto". This is much less prone
- +to error than the old method of manually adding prototypes
- +
- +
- +
- +
- +
- +
- +****************************************
- +Date: Monday June 10, 1996 @ 15:16
- +Author: tridge
- +
- +Update of /data/cvs/samba/source
- +In directory arvidsjaur:/var/tmp/cvs-serv2785
- +
- +Modified Files:
- + ipc.c password.c reply.c server.c smb.h trans2.c util.c
- +Log Message:
- +a cleanup of the receive_smb() usage, adding timeouts in some places
- +
- +also added paranoid code in the main process() loop of smbd to detect
- +when smbd is looping uselessly. This should stop the "smbd is chewing
- +lots of cpu" reports
- +
- +
- +
- +
- +
- +
- +
- +****************************************
- +Date: Monday June 10, 1996 @ 15:20
- +Author: samba-bu
- +
- +Update of /data/cvs/samba/source
- +In directory arvidsjaur:/samba/samba-bugs/samba/source
- +
- +Modified Files:
- + version.h
- +Log Message:
- +preparing for release of 1.9.16alpha10
- +
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/dir.c samba-1.9.16alpha10/source/dir.c
- --- samba-1.9.16alpha9/source/dir.c Thu Jun 6 01:44:17 1996
- +++ samba-1.9.16alpha10/source/dir.c Mon Jun 10 15:18:51 1996
- @@ -20,7 +20,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int DEBUGLEVEL;
- extern connection_struct Connections[];
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/interface.c samba-1.9.16alpha10/source/interface.c
- --- samba-1.9.16alpha9/source/interface.c Sat Jun 8 15:37:52 1996
- +++ samba-1.9.16alpha10/source/interface.c Mon Jun 10 15:18:51 1996
- @@ -20,7 +20,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int DEBUGLEVEL;
-
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/ipc.c samba-1.9.16alpha10/source/ipc.c
- --- samba-1.9.16alpha9/source/ipc.c Thu Jun 6 21:57:21 1996
- +++ samba-1.9.16alpha10/source/ipc.c Mon Jun 10 15:18:52 1996
- @@ -24,8 +24,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
- -#include "pcap.h"
-
- #ifdef CHECK_TYPES
- #undef CHECK_TYPES
- @@ -2792,12 +2790,9 @@
- while (pscnt < tpscnt || dscnt < tdscnt)
- {
- int pcnt,poff,dcnt,doff,pdisp,ddisp;
- -
- - receive_smb(Client,inbuf, 0);
- - show_msg(inbuf);
- -
- - /* Ensure this is still a trans packet (sanity check) */
- - if(CVAL(inbuf, smb_com) != SMBtrans)
- +
- + if (!receive_smb(Client,inbuf, SMB_SECONDARY_WAIT*1000) ||
- + CVAL(inbuf, smb_com) != SMBtrans)
- {
- DEBUG(2,("Invalid secondary trans2 packet\n"));
- if (params) free(params);
- @@ -2805,6 +2800,8 @@
- if (setup) free(setup);
- return(ERROR(ERRSRV,ERRerror));
- }
- +
- + show_msg(inbuf);
-
- tpscnt = SVAL(inbuf,smb_vwv0);
- tdscnt = SVAL(inbuf,smb_vwv1);
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/loadparm.c samba-1.9.16alpha10/source/loadparm.c
- --- samba-1.9.16alpha9/source/loadparm.c Fri Jun 7 15:36:53 1996
- +++ samba-1.9.16alpha10/source/loadparm.c Mon Jun 10 15:18:53 1996
- @@ -49,10 +49,6 @@
-
- #include "includes.h"
-
- -#include "params.h"
- -#include "loadparm.h"
- -#include "pcap.h"
- -
- BOOL bLoaded = False;
-
- extern int DEBUGLEVEL;
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/loadparm.h samba-1.9.16alpha10/source/loadparm.h
- --- samba-1.9.16alpha9/source/loadparm.h Fri Jun 7 15:36:53 1996
- +++ samba-1.9.16alpha10/source/loadparm.h Thu Jan 1 10:00:00 1970
- @@ -1,167 +0,0 @@
- -/*
- - Unix SMB/Netbios implementation.
- - Version 1.9.
- - Parameter loading functions
- - Copyright (C) Karl Auer 1993, 1994
- -
- - Extensively modified by Andrew Tridgell
- -
- - This program is free software; you can redistribute it and/or modify
- - it under the terms of the GNU General Public License as published by
- - the Free Software Foundation; either version 2 of the License, or
- - (at your option) any later version.
- -
- - This program is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- - GNU General Public License for more details.
- -
- - You should have received a copy of the GNU General Public License
- - along with this program; if not, write to the Free Software
- - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- -*/
- -
- -/*
- - *
- - * Prototypes etc for loadparm.c.
- - *
- - */
- -#ifndef _LOADPARM_H
- -#define _LOADPARM_H
- -
- -#include "smb.h"
- -
- -extern BOOL lp_file_list_changed(void);
- -extern void lp_killunused(BOOL (*snumused)(int ));
- -extern BOOL lp_loaded(void);
- -extern BOOL lp_snum_ok(int iService);
- -extern BOOL lp_manglednames(int iService);
- -extern char *lp_interfaces(void);
- -extern char *lp_passwordserver(void);
- -extern char *lp_passwd_program(void);
- -extern char *lp_passwd_chat(void);
- -extern char *lp_guestaccount(int iService);
- -extern char *lp_printcapname(void);
- -extern char *lp_lockdir(void);
- -extern char *lp_logfile(void);
- -extern char *lp_smbrun(void);
- -extern char *lp_configfile(void);
- -extern char *lp_smb_passwd_file(void);
- -extern char *lp_rootdir(void);
- -extern char *lp_defaultservice(void);
- -extern char *lp_serverstring(void);
- -extern char *lp_dfree_command(void);
- -extern char *lp_msg_command(void);
- -extern char *lp_workgroup(void);
- -extern char *lp_domain_controller(void);
- -extern char *lp_username_map(void);
- -extern char *lp_hosts_equiv(void);
- -extern char *lp_logon_script(void);
- -extern char *lp_wins_server(void);
- -extern char *lp_magicscript(int iService);
- -extern char *lp_magicoutput(int iService);
- -extern char *lp_mangled_map(int iService);
- -char *volume_label(int snum);
- -extern int lp_os_level(void);
- -extern int lp_max_ttl(void);
- -extern int lp_max_log_size(void);
- -extern int lp_maxxmit(void);
- -extern int lp_maxmux(void);
- -extern int lp_mangledstack(void);
- -extern BOOL lp_wins_support(void);
- -extern BOOL lp_wins_proxy(void);
- -extern BOOL lp_preferred_master(void);
- -extern BOOL lp_domain_master(void);
- -extern BOOL lp_domain_logons(void);
- -extern BOOL lp_getwdcache(void);
- -extern BOOL lp_use_rhosts(void);
- -extern BOOL lp_readprediction(void);
- -extern BOOL lp_readbmpx(void);
- -extern BOOL lp_readraw(void);
- -extern BOOL lp_writeraw(void);
- -extern BOOL lp_null_passwords(void);
- -extern BOOL lp_strip_dot(void);
- -extern BOOL lp_encrypted_passwords(void);
- -extern BOOL lp_syslog_only(void);
- -extern BOOL lp_browse_list(void);
- -extern int lp_numservices(void);
- -extern int lp_keepalive(void);
- -extern int lp_passwordlevel(void);
- -extern int lp_security(void);
- -extern int lp_printing(void);
- -extern int lp_maxdisksize(void);
- -extern int lp_lpqcachetime(void);
- -extern int lp_syslog(void);
- -extern int lp_deadtime(void);
- -extern int lp_readsize(void);
- -extern int lp_debuglevel(void);
- -extern int lp_maxprotocol(void);
- -extern int lp_maxpacket(void);
- -extern char *lp_comment(int iService);
- -extern char *lp_preexec(int iService);
- -extern char *lp_postexec(int iService);
- -extern char *lp_rootpreexec(int iService);
- -extern char *lp_rootpostexec(int iService);
- -extern char *lp_servicename(int iService);
- -extern char *lp_pathname(int iService);
- -extern char *lp_username(int iService);
- -extern char *lp_invalid_users(int iService);
- -extern char *lp_valid_users(int iService);
- -extern char *lp_admin_users(int iService);
- -extern char *lp_printcommand(int iService);
- -extern char *lp_lpqcommand(int iService);
- -extern char *lp_lprmcommand(int iService);
- -extern char *lp_lppausecommand(int iService);
- -extern char *lp_lpresumecommand(int iService);
- -extern char *lp_printername(int iService);
- -extern char *lp_hostsallow(int iService);
- -extern char *lp_hostsdeny(int iService);
- -extern char *lp_dontdescend(int iService);
- -extern char *lp_force_user(int iService);
- -extern char *lp_force_group(int iService);
- -extern char *lp_readlist(int iService);
- -extern char *lp_writelist(int iService);
- -extern BOOL lp_alternate_permissions(int iService);
- -extern BOOL lp_revalidate(int iService);
- -extern BOOL lp_status(int iService);
- -extern BOOL lp_hide_dot_files(int iService);
- -extern BOOL lp_browseable(int iService);
- -extern BOOL lp_widelinks(int iService);
- -extern BOOL lp_syncalways(int iService);
- -extern BOOL lp_readonly(int iService);
- -extern BOOL lp_no_set_dir(int iService);
- -extern BOOL lp_guest_ok(int iService);
- -extern BOOL lp_guest_only(int iService);
- -extern BOOL lp_print_ok(int iService);
- -extern BOOL lp_postscript(int iService);
- -extern BOOL lp_map_hidden(int iService);
- -extern BOOL lp_map_archive(int iService);
- -extern BOOL lp_locking(int iService);
- -extern BOOL lp_strict_locking(int iService);
- -extern BOOL lp_share_modes(int iService);
- -extern BOOL lp_onlyuser(int iService);
- -extern BOOL lp_map_system(int iService);
- -extern BOOL lp_casesensitive(int iService);
- -extern BOOL lp_casemangle(int iService);
- -extern BOOL lp_preservecase(int iService);
- -extern BOOL lp_shortpreservecase(int iService);
- -extern BOOL lp_load(char *pszFname,BOOL global_only);
- -extern void lp_dump(void);
- -extern int lp_servicenumber(char *pszServiceName);
- -extern BOOL lp_add_home(char *pszHomename,
- - int iDefaultService, char *pszHomedir);
- -extern int lp_add_service(char *service, int iDefaultService);
- -extern BOOL lp_add_printer(char *pszPrintername, int iDefaultService);
- -extern BOOL lp_readonly(int iService);
- -extern int lp_create_mode(int iService);
- -extern int lp_minprintspace(int iService);
- -extern int lp_defaultcase(int iService);
- -extern char lp_magicchar(int iService);
- -extern int lp_max_connections(int iService);
- -extern BOOL lp_add_home(char *pservice,int ifrom,char *phome);
- -extern char *lp_string(char *s);
- -extern BOOL lp_delete_readonly(int iService);
- -char *my_workgroup(void);
- -
- -#endif
- -
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/localnet.h samba-1.9.16alpha10/source/localnet.h
- --- samba-1.9.16alpha9/source/localnet.h Thu Jun 6 21:57:21 1996
- +++ samba-1.9.16alpha10/source/localnet.h Thu Jan 1 10:00:00 1970
- @@ -1,2 +0,0 @@
- -extern int ClientNMB;
- -extern int ClientDGRAM;
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/locking.c samba-1.9.16alpha10/source/locking.c
- --- samba-1.9.16alpha9/source/locking.c Sat May 4 17:50:24 1996
- +++ samba-1.9.16alpha10/source/locking.c Mon Jun 10 15:18:54 1996
- @@ -20,12 +20,142 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
- extern int DEBUGLEVEL;
- extern connection_struct Connections[];
- extern files_struct Files[];
-
- pstring share_del_pending="";
- +
- +
- +/****************************************************************************
- +routine to do file locking
- +****************************************************************************/
- +BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type)
- +{
- +#if HAVE_FCNTL_LOCK
- + struct flock lock;
- + int ret;
- +
- +#if 1
- + uint32 mask = 0xC0000000;
- +
- + /* make sure the count is reasonable, we might kill the lockd otherwise */
- + count &= ~mask;
- +
- + /* the offset is often strange - remove 2 of its bits if either of
- + the top two bits are set. Shift the top ones by two bits. This
- + still allows OLE2 apps to operate, but should stop lockd from
- + dieing */
- + if ((offset & mask) != 0)
- + offset = (offset & ~mask) | ((offset & mask) >> 2);
- +#else
- + unsigned long mask = ((unsigned)1<<31);
- +
- + /* interpret negative counts as large numbers */
- + if (count < 0)
- + count &= ~mask;
- +
- + /* no negative offsets */
- + offset &= ~mask;
- +
- + /* count + offset must be in range */
- + while ((offset < 0 || (offset + count < 0)) && mask)
- + {
- + offset &= ~mask;
- + mask = mask >> 1;
- + }
- +#endif
- +
- +
- + DEBUG(5,("fcntl_lock %d %d %d %d %d\n",fd,op,(int)offset,(int)count,type));
- +
- + lock.l_type = type;
- + lock.l_whence = SEEK_SET;
- + lock.l_start = (int)offset;
- + lock.l_len = (int)count;
- + lock.l_pid = 0;
- +
- + errno = 0;
- +
- + ret = fcntl(fd,op,&lock);
- +
- + if (errno != 0)
- + DEBUG(3,("fcntl lock gave errno %d (%s)\n",errno,strerror(errno)));
- +
- + /* a lock query */
- + if (op == F_GETLK)
- + {
- + if ((ret != -1) &&
- + (lock.l_type != F_UNLCK) &&
- + (lock.l_pid != 0) &&
- + (lock.l_pid != getpid()))
- + {
- + DEBUG(3,("fd %d is locked by pid %d\n",fd,lock.l_pid));
- + return(True);
- + }
- +
- + /* it must be not locked or locked by me */
- + return(False);
- + }
- +
- + /* a lock set or unset */
- + if (ret == -1)
- + {
- + DEBUG(3,("lock failed at offset %d count %d op %d type %d (%s)\n",
- + offset,count,op,type,strerror(errno)));
- +
- + /* perhaps it doesn't support this sort of locking?? */
- + if (errno == EINVAL)
- + {
- + DEBUG(3,("locking not supported? returning True\n"));
- + return(True);
- + }
- +
- + return(False);
- + }
- +
- + /* everything went OK */
- + DEBUG(5,("Lock call successful\n"));
- +
- + return(True);
- +#else
- + return(False);
- +#endif
- +}
- +
- +/*******************************************************************
- +lock a file - returning a open file descriptor or -1 on failure
- +The timeout is in seconds. 0 means no timeout
- +********************************************************************/
- +int file_lock(char *name,int timeout)
- +{
- + int fd = open(name,O_RDWR|O_CREAT,0666);
- + time_t t=0;
- + if (fd < 0) return(-1);
- +
- +#if HAVE_FCNTL_LOCK
- + if (timeout) t = time(NULL);
- + while (!timeout || (time(NULL)-t < timeout)) {
- + if (fcntl_lock(fd,F_SETLK,0,1,F_WRLCK)) return(fd);
- + msleep(LOCK_RETRY_TIMEOUT);
- + }
- + return(-1);
- +#else
- + return(fd);
- +#endif
- +}
- +
- +/*******************************************************************
- +unlock a file locked by file_lock
- +********************************************************************/
- +void file_unlock(int fd)
- +{
- + if (fd<0) return;
- +#if HAVE_FCNTL_LOCK
- + fcntl_lock(fd,F_SETLK,0,1,F_UNLCK);
- +#endif
- + close(fd);
- +}
-
-
- /****************************************************************************
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/mangle.c samba-1.9.16alpha10/source/mangle.c
- --- samba-1.9.16alpha9/source/mangle.c Sun May 5 17:18:39 1996
- +++ samba-1.9.16alpha10/source/mangle.c Mon Jun 10 15:18:54 1996
- @@ -20,7 +20,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int DEBUGLEVEL;
- extern int case_default;
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/message.c samba-1.9.16alpha10/source/message.c
- --- samba-1.9.16alpha9/source/message.c Sat May 4 17:50:24 1996
- +++ samba-1.9.16alpha10/source/message.c Mon Jun 10 15:18:54 1996
- @@ -25,7 +25,6 @@
-
-
- #include "includes.h"
- -#include "loadparm.h"
-
- /* look in server.c for some explanation of these variables */
- extern int DEBUGLEVEL;
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/mkproto.awk samba-1.9.16alpha10/source/mkproto.awk
- --- samba-1.9.16alpha9/source/mkproto.awk Tue Jun 4 16:53:22 1996
- +++ samba-1.9.16alpha10/source/mkproto.awk Mon Jun 10 15:18:54 1996
- @@ -3,6 +3,8 @@
-
- BEGIN {
- inheader=0;
- + print "/* This file is automatically generated with \"make proto\". DO NOT EDIT */"
- + print ""
- }
-
- {
- @@ -15,6 +17,43 @@
- }
- next;
- }
- +}
- +
- +# we handle the loadparm.c fns separately
- +
- +/^FN_LOCAL_BOOL/ {
- + split($0,a,"[,()]")
- + printf "BOOL %s(int );\n", a[2]
- +}
- +
- +/^FN_LOCAL_STRING/ {
- + split($0,a,"[,()]")
- + printf "char *%s(int );\n", a[2]
- +}
- +
- +/^FN_LOCAL_INT/ {
- + split($0,a,"[,()]")
- + printf "int %s(int );\n", a[2]
- +}
- +
- +/^FN_LOCAL_CHAR/ {
- + split($0,a,"[,()]")
- + printf "char %s(int );\n", a[2]
- +}
- +
- +/^FN_GLOBAL_BOOL/ {
- + split($0,a,"[,()]")
- + printf "BOOL %s(void);\n", a[2]
- +}
- +
- +/^FN_GLOBAL_STRING/ {
- + split($0,a,"[,()]")
- + printf "char *%s(void);\n", a[2]
- +}
- +
- +/^FN_GLOBAL_INT/ {
- + split($0,a,"[,()]")
- + printf "int %s(void);\n", a[2]
- }
-
- /^static|^extern/ || !/^[a-zA-Z]/ || /[;]/ {
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/nameannounce.c samba-1.9.16alpha10/source/nameannounce.c
- --- samba-1.9.16alpha9/source/nameannounce.c Sat Jun 8 15:37:52 1996
- +++ samba-1.9.16alpha10/source/nameannounce.c Mon Jun 10 15:18:55 1996
- @@ -26,7 +26,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- #define TEST_CODE
-
- @@ -41,7 +40,7 @@
- extern int ClientNMB;
-
- /* this is our domain/workgroup/server database */
- -extern struct domain_record *domainlist;
- +extern struct subnet_record *subnetlist;
-
- /* machine comment for host announcements */
- extern pstring ServerComment;
- @@ -119,7 +118,7 @@
- time_t t = time(NULL);
- pstring outbuf;
- char *p;
- - struct domain_record *d1;
- + struct subnet_record *d1;
- int tok;
-
- if (!lastrun) lastrun = t;
- @@ -128,10 +127,10 @@
-
- for (tok = 0; tok <= workgroup_count; tok++)
- {
- - for (d1 = domainlist; d1; d1 = d1->next)
- + for (d1 = subnetlist; d1; d1 = d1->next)
- {
- struct work_record *work;
- - struct domain_record *d;
- + struct subnet_record *d;
-
- /* search for unique workgroup: only the name matters */
- for (work = d1->workgrouplist;
- @@ -141,7 +140,7 @@
- if (!work) continue;
-
- /* found one: announce it across all domains */
- - for (d = domainlist; d; d = d->next)
- + for (d = subnetlist; d; d = d->next)
- {
- int type=0;
-
- @@ -192,17 +191,17 @@
- char *commentp;
- pstring comment;
- char *my_name;
- - struct domain_record *d;
- + struct subnet_record *d;
-
- StrnCpy(comment, *ServerComment ? ServerComment : "NoComment", 43);
-
- my_name = *myname ? myname : "NoName";
-
- - for (d = domainlist; d; d = d->next)
- + for (d = subnetlist; d; d = d->next)
- {
- struct work_record *work;
-
- - if (!ismybcast(d->bcast_ip))
- + if (!d->my_interface)
- continue;
-
- for (work = d->workgrouplist; work; work = work->next)
- @@ -229,7 +228,7 @@
-
- work->lastannounce_time = t;
-
- - if (!ismybcast(d->bcast_ip)) {
- + if (!d->my_interface) {
- stype &= ~(SV_TYPE_POTENTIAL_BROWSER | SV_TYPE_MASTER_BROWSER |
- SV_TYPE_DOMAIN_MASTER | SV_TYPE_BACKUP_BROWSER |
- SV_TYPE_DOMAIN_CTRL | SV_TYPE_DOMAIN_MEMBER);
- @@ -264,7 +263,7 @@
- p = p+31;
- p = skip_string(p,1);
-
- - if (ismybcast(d->bcast_ip))
- + if (d->my_interface)
- {
- if (AM_MASTER(work))
- {
- @@ -338,7 +337,7 @@
- **************************************************************************/
- void announce_master(void)
- {
- - struct domain_record *d;
- + struct subnet_record *d;
- static time_t last=0;
- time_t t = time(NULL);
- BOOL am_master = False; /* are we a master of some sort? :-) */
- @@ -348,7 +347,7 @@
-
- last = t;
-
- - for (d = domainlist; d; d = d->next)
- + for (d = subnetlist; d; d = d->next)
- {
- struct work_record *work;
- for (work = d->workgrouplist; work; work = work->next)
- @@ -362,7 +361,7 @@
-
- if (!am_master) return; /* only proceed if we are a master browser */
-
- - for (d = domainlist; d; d = d->next)
- + for (d = subnetlist; d; d = d->next)
- {
- struct work_record *work;
- for (work = d->workgrouplist; work; work = work->next)
- @@ -394,8 +393,8 @@
- }
- else
- {
- - struct domain_record *d2;
- - for (d2 = domainlist; d2; d2 = d2->next)
- + struct subnet_record *d2;
- + for (d2 = subnetlist; d2; d2 = d2->next)
- {
- queue_netbios_packet(ClientNMB,NMB_QUERY,
- MASTER_SERVER_CHECK,
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/namedb.c samba-1.9.16alpha10/source/namedb.c
- --- samba-1.9.16alpha9/source/namedb.c Sat Jun 8 15:37:53 1996
- +++ samba-1.9.16alpha10/source/namedb.c Mon Jun 10 15:18:56 1996
- @@ -27,7 +27,6 @@
-
- #include "includes.h"
- #include "smb.h"
- -#include "loadparm.h"
-
- extern int ClientNMB;
- extern int ClientDGRAM;
- @@ -44,7 +43,7 @@
- struct browse_cache_record *browserlist = NULL;
-
- /* this is our domain/workgroup/server database */
- -struct domain_record *domainlist = NULL;
- +struct subnet_record *subnetlist = NULL;
-
- static BOOL updatedlists = True;
- int updatecount=0;
- @@ -61,7 +60,7 @@
- /****************************************************************************
- add a workgroup into the domain list
- **************************************************************************/
- -static void add_workgroup(struct work_record *work, struct domain_record *d)
- +static void add_workgroup(struct work_record *work, struct subnet_record *d)
- {
- struct work_record *w2;
-
- @@ -89,7 +88,7 @@
- static struct work_record *make_workgroup(char *name)
- {
- struct work_record *work;
- - struct domain_record *d;
- + struct subnet_record *d;
- int t = -1;
-
- if (!name || !name[0]) return NULL;
- @@ -108,7 +107,7 @@
-
- /* make sure all token representations of workgroups are unique */
-
- - for (d = domainlist; d && t == -1; d = d->next)
- + for (d = subnetlist; d && t == -1; d = d->next)
- {
- struct work_record *w;
- for (w = d->workgrouplist; w && t == -1; w = w->next)
- @@ -177,7 +176,7 @@
- /*******************************************************************
- remove workgroups
- ******************************************************************/
- -struct work_record *remove_workgroup(struct domain_record *d,
- +struct work_record *remove_workgroup(struct subnet_record *d,
- struct work_record *work)
- {
- struct work_record *ret_work = NULL;
- @@ -204,19 +203,19 @@
- /****************************************************************************
- add a domain into the list
- **************************************************************************/
- -static void add_domain(struct domain_record *d)
- +static void add_subnet(struct subnet_record *d)
- {
- - struct domain_record *d2;
- + struct subnet_record *d2;
-
- - if (!domainlist)
- + if (!subnetlist)
- {
- - domainlist = d;
- + subnetlist = d;
- d->prev = NULL;
- d->next = NULL;
- return;
- }
-
- - for (d2 = domainlist; d2->next; d2 = d2->next);
- + for (d2 = subnetlist; d2->next; d2 = d2->next);
-
- d2->next = d;
- d->next = NULL;
- @@ -305,7 +304,7 @@
- that it get created/added anyway. this allows us to force entries in
- lmhosts file to be added.
- **************************************************************************/
- -struct work_record *find_workgroupstruct(struct domain_record *d,
- +struct work_record *find_workgroupstruct(struct subnet_record *d,
- fstring name, BOOL add)
- {
- struct work_record *ret, *work;
- @@ -342,13 +341,13 @@
- {
- if (lp_preferred_master() &&
- strequal(lp_workgroup(), name) &&
- - ismybcast(d->bcast_ip))
- + d->my_interface)
- {
- DEBUG(3, ("preferred master startup for %s\n", work->work_group));
- work->needelection = True;
- work->ElectionCriterion |= (1<<3);
- }
- - if (!ismybcast(d->bcast_ip))
- + if (!d->my_interface)
- {
- work->needelection = False;
- }
- @@ -359,21 +358,19 @@
- }
-
- /****************************************************************************
- - find a domain in the domainlist
- + find a domain in the subnetlist
- **************************************************************************/
- -struct domain_record *find_domain(struct in_addr source_ip)
- +struct subnet_record *find_domain(struct in_addr ip)
- {
- - struct domain_record *d;
- + struct subnet_record *d;
-
- /* search through domain list for broadcast/netmask that matches
- the source ip address */
-
- - for (d = domainlist; d; d = d->next)
- + for (d = subnetlist; d; d = d->next)
- {
- - if (same_net(source_ip, d->bcast_ip, d->mask_ip))
- - {
- - return(d);
- - }
- + if (same_net(ip, d->bcast_ip, d->mask_ip))
- + return(d);
- }
-
- return (NULL);
- @@ -385,9 +382,9 @@
- **************************************************************************/
- void dump_workgroups(void)
- {
- - struct domain_record *d;
- + struct subnet_record *d;
-
- - for (d = domainlist; d; d = d->next)
- + for (d = subnetlist; d; d = d->next)
- {
- if (d->workgrouplist)
- {
- @@ -416,23 +413,25 @@
- /****************************************************************************
- create a domain entry
- ****************************************************************************/
- -static struct domain_record *make_domain(struct in_addr ip, struct in_addr mask)
- +static struct subnet_record *make_subnet(struct in_addr bcast_ip,
- + struct in_addr mask)
- {
- - struct domain_record *d;
- - d = (struct domain_record *)malloc(sizeof(*d));
- + struct subnet_record *d;
- + d = (struct subnet_record *)malloc(sizeof(*d));
-
- if (!d) return(NULL);
-
- bzero((char *)d,sizeof(*d));
-
- - DEBUG(4, ("making domain %s ", inet_ntoa(ip)));
- - DEBUG(4, ("%s\n", inet_ntoa(mask)));
- + DEBUG(4,("making subnet %s ", inet_ntoa(bcast_ip)));
- + DEBUG(4,("%s\n", inet_ntoa(mask)));
-
- - d->bcast_ip = ip;
- + d->bcast_ip = bcast_ip;
- d->mask_ip = mask;
- d->workgrouplist = NULL;
- -
- - add_domain(d);
- + d->my_interface = ismybcast(d->bcast_ip);
- +
- + add_subnet(d);
-
- return d;
- }
- @@ -441,11 +440,11 @@
- add a domain entry. creates a workgroup, if necessary, and adds the domain
- to the named a workgroup.
- ****************************************************************************/
- -struct domain_record *add_domain_entry(struct in_addr source_ip,
- +struct subnet_record *add_subnet_entry(struct in_addr source_ip,
- struct in_addr source_mask,
- char *name, BOOL add)
- {
- - struct domain_record *d;
- + struct subnet_record *d;
- struct in_addr ip;
-
- ip = ipgrp;
- @@ -455,7 +454,7 @@
-
- /* add the domain into our domain database */
- if ((d = find_domain(source_ip)) ||
- - (d = make_domain(source_ip, source_mask)))
- + (d = make_subnet(source_ip, source_mask)))
- {
- struct work_record *w = find_workgroupstruct(d, name, add);
-
- @@ -547,7 +546,7 @@
- /****************************************************************************
- add a server entry
- ****************************************************************************/
- -struct server_record *add_server_entry(struct domain_record *d,
- +struct server_record *add_server_entry(struct subnet_record *d,
- struct work_record *work,
- char *name,int servertype,
- int ttl,char *comment,
- @@ -584,7 +583,7 @@
- bzero((char *)s,sizeof(*s));
- }
-
- - if (ismybcast(d->bcast_ip) &&
- + if (d->my_interface &&
- strequal(lp_workgroup(),work->work_group))
- {
- if (servertype)
- @@ -633,7 +632,7 @@
- ******************************************************************/
- void write_browse_list(void)
- {
- - struct domain_record *d;
- + struct subnet_record *d;
-
- pstring fname,fnamenew;
- FILE *f;
- @@ -661,7 +660,7 @@
- return;
- }
-
- - for (d = domainlist; d ; d = d->next)
- + for (d = subnetlist; d ; d = d->next)
- {
- struct work_record *work;
- for (work = d->workgrouplist; work ; work = work->next)
- @@ -706,9 +705,9 @@
- ******************************************************************/
- void expire_servers(time_t t)
- {
- - struct domain_record *d;
- + struct subnet_record *d;
-
- - for (d = domainlist ; d ; d = d->next)
- + for (d = subnetlist ; d ; d = d->next)
- {
- struct work_record *work;
-
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/nameelect.c samba-1.9.16alpha10/source/nameelect.c
- --- samba-1.9.16alpha9/source/nameelect.c Sat Jun 8 15:37:53 1996
- +++ samba-1.9.16alpha10/source/nameelect.c Mon Jun 10 15:18:56 1996
- @@ -26,7 +26,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int ClientNMB;
- extern int ClientDGRAM;
- @@ -47,7 +46,7 @@
-
- #define BROWSE_MAILSLOT "\\MAILSLOT\\BROWSE"
-
- -extern struct domain_record *domainlist;
- +extern struct subnet_record *subnetlist;
-
-
- /*******************************************************************
- @@ -57,7 +56,7 @@
- {
- static time_t lastrun=0;
- time_t t = time(NULL);
- - struct domain_record *d;
- + struct subnet_record *d;
-
- if (!lastrun) lastrun = t;
- if (t < lastrun + CHECK_TIME_MST_BROWSE * 60)
- @@ -67,7 +66,7 @@
-
- dump_workgroups();
-
- - for (d = domainlist; d; d = d->next)
- + for (d = subnetlist; d; d = d->next)
- {
- struct work_record *work;
-
- @@ -92,13 +91,13 @@
- ******************************************************************/
- void browser_gone(char *work_name, struct in_addr ip)
- {
- - struct domain_record *d = find_domain(ip);
- + struct subnet_record *d = find_domain(ip);
- struct work_record *work = find_workgroupstruct(d, work_name, False);
-
- if (!work || !d) return;
-
- if (strequal(work->work_group, lp_workgroup()) &&
- - ismybcast(d->bcast_ip))
- + d->my_interface)
- {
-
- DEBUG(2,("Forcing election on %s %s\n",
- @@ -125,7 +124,7 @@
- /****************************************************************************
- send an election packet
- **************************************************************************/
- -void send_election(struct domain_record *d, char *group,uint32 criterion,
- +void send_election(struct subnet_record *d, char *group,uint32 criterion,
- int timeup,char *name)
- {
- pstring outbuf;
- @@ -157,7 +156,7 @@
- /*******************************************************************
- become the master browser
- ******************************************************************/
- -static void become_master(struct domain_record *d, struct work_record *work)
- +static void become_master(struct subnet_record *d, struct work_record *work)
- {
- uint32 domain_type = SV_TYPE_DOMAIN_ENUM | SV_TYPE_SERVER_UNIX | 0x00400000;
-
- @@ -192,7 +191,7 @@
- add_server_entry(d,work,work->work_group,domain_type,0,myname,True);
- add_server_entry(d,work,myname,work->ServerType,0,ServerComment,True);
-
- - if (ismybcast(d->bcast_ip))
- + if (d->my_interface)
- {
- /* ask all servers on our local net to announce to us */
- announce_request(work, d->bcast_ip);
- @@ -203,7 +202,7 @@
- /*******************************************************************
- unbecome the master browser
- ******************************************************************/
- -void become_nonmaster(struct domain_record *d, struct work_record *work)
- +void become_nonmaster(struct subnet_record *d, struct work_record *work)
- {
- DEBUG(2,("Becoming non-master for %s\n",work->work_group));
-
- @@ -227,14 +226,14 @@
- time_t t = time(NULL);
- static time_t lastime = 0;
-
- - struct domain_record *d;
- + struct subnet_record *d;
-
- /* send election packets once a second */
- if (lastime && t-lastime <= 0) return;
-
- lastime = t;
-
- - for (d = domainlist; d; d = d->next)
- + for (d = subnetlist; d; d = d->next)
- {
- struct work_record *work;
- for (work = d->workgrouplist; work; work = work->next)
- @@ -293,7 +292,7 @@
- {
- struct dgram_packet *dgram = &p->packet.dgram;
- struct in_addr ip = dgram->header.source_ip;
- - struct domain_record *d = find_domain(ip);
- + struct subnet_record *d = find_domain(ip);
- int version = CVAL(buf,0);
- uint32 criterion = IVAL(buf,1);
- int timeup = IVAL(buf,5)/1000;
- @@ -313,7 +312,7 @@
- {
- if (listening_name(work, &dgram->dest_name) &&
- strequal(work->work_group, lp_workgroup()) &&
- - ismybcast(d->bcast_ip))
- + d->my_interface)
- {
- if (win_election(work, version,criterion,timeup,name))
- {
- @@ -350,10 +349,10 @@
- ***************************************************************************/
- BOOL check_elections(void)
- {
- - struct domain_record *d;
- + struct subnet_record *d;
- BOOL run_any_election = False;
-
- - for (d = domainlist; d; d = d->next)
- + for (d = subnetlist; d; d = d->next)
- {
- struct work_record *work;
- for (work = d->workgrouplist; work; work = work->next)
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/nameresp.c samba-1.9.16alpha10/source/nameresp.c
- --- samba-1.9.16alpha9/source/nameresp.c Sat Jun 8 15:37:53 1996
- +++ samba-1.9.16alpha10/source/nameresp.c Mon Jun 10 15:18:56 1996
- @@ -21,7 +21,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int ClientNMB;
- extern int ClientDGRAM;
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/nameserv.c samba-1.9.16alpha10/source/nameserv.c
- --- samba-1.9.16alpha9/source/nameserv.c Sat Jun 8 15:37:53 1996
- +++ samba-1.9.16alpha10/source/nameserv.c Mon Jun 10 15:18:56 1996
- @@ -26,7 +26,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int ClientNMB;
- extern int ClientDGRAM;
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/nameserv.h samba-1.9.16alpha10/source/nameserv.h
- --- samba-1.9.16alpha9/source/nameserv.h Sat Jun 8 15:37:53 1996
- +++ samba-1.9.16alpha10/source/nameserv.h Mon Jun 10 15:18:56 1996
- @@ -144,17 +144,19 @@
- uint32 ElectionCriterion;
- };
-
- -/* a domain structure. it contains a list of workgroups */
- -struct domain_record
- +/* a subnet structure. it contains a list of workgroups */
- +struct subnet_record
- {
- - struct domain_record *next;
- - struct domain_record *prev;
- + struct subnet_record *next;
- + struct subnet_record *prev;
-
- struct work_record *workgrouplist;
-
- struct in_addr bcast_ip;
- struct in_addr mask_ip;
- struct in_addr myip;
- +
- + BOOL my_interface;
- };
-
- /* a resource record */
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/namework.c samba-1.9.16alpha10/source/namework.c
- --- samba-1.9.16alpha9/source/namework.c Sat Jun 8 15:37:54 1996
- +++ samba-1.9.16alpha10/source/namework.c Mon Jun 10 15:18:56 1996
- @@ -26,7 +26,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int ClientNMB;
- extern int ClientDGRAM;
- @@ -50,7 +49,7 @@
- extern struct browse_cache_record *browserlist;
-
- /* this is our domain/workgroup/server database */
- -extern struct domain_record *domainlist;
- +extern struct subnet_record *subnetlist;
-
- /* machine comment for host announcements */
- extern pstring ServerComment;
- @@ -107,8 +106,8 @@
- **************************************************************************/
- void tell_become_backup(void)
- {
- - struct domain_record *d;
- - for (d = domainlist; d; d = d->next)
- + struct subnet_record *d;
- + for (d = subnetlist; d; d = d->next)
- {
- struct work_record *work;
- for (work = d->workgrouplist; work; work = work->next)
- @@ -161,7 +160,7 @@
- **************************************************************************/
- static BOOL sync_browse_entry(struct browse_cache_record *b)
- {
- - struct domain_record *d;
- + struct subnet_record *d;
- struct work_record *work;
- /*
- if (!strequal(serv_name, b->name))
- @@ -245,13 +244,13 @@
- if (type >= 0x1b && type <= 0x1e)
- {
- struct work_record *work;
- - struct domain_record *d;
- + struct subnet_record *d;
-
- if (!(d = find_domain(ip))) return;
- if (!(work = find_workgroupstruct(d, name, False))) return;
-
- /* request the server to announce if on our subnet */
- - if (ismybcast(d->bcast_ip)) announce_request(work, ip);
- + if (d->my_interface) announce_request(work, ip);
-
- /* domain master type or master browser type */
- if (type == 0x1b || type == 0x1d)
- @@ -280,7 +279,7 @@
- for (i=0;i<n;i++) {
- ip = iface_n_ip(i);
- if (!ip) return;
- - add_domain_entry(*iface_bcast(*ip),*iface_nmask(*ip),lp_workgroup(),True);
- + add_subnet_entry(*iface_bcast(*ip),*iface_nmask(*ip),lp_workgroup(),True);
- }
- }
-
- @@ -292,7 +291,7 @@
- int info_count, int token, int info,
- int name_type, struct in_addr ip)
- {
- - struct domain_record *d;
- + struct subnet_record *d;
- char outbuf[1024];
- char *p, *countptr, *nameptr;
- int count = 0;
- @@ -331,7 +330,7 @@
-
- nameptr = p;
-
- - for (d = domainlist; d; d = d->next)
- + for (d = subnetlist; d; d = d->next)
- {
- struct work_record *work;
-
- @@ -465,7 +464,7 @@
- {
- struct dgram_packet *dgram = &p->packet.dgram;
- struct in_addr ip = dgram->header.source_ip;
- - struct domain_record *d = find_domain(ip);
- + struct subnet_record *d = find_domain(ip);
- int update_count = CVAL(buf,0);
- int ttl = IVAL(buf,1)/1000;
- char *name = buf+5;
- @@ -546,8 +545,8 @@
- {
- struct dgram_packet *dgram = &p->packet.dgram;
- struct in_addr ip = dgram->header.source_ip;
- - struct domain_record *d = find_domain(ip);
- - struct domain_record *mydomain = find_domain(*iface_bcast(ip));
- + struct subnet_record *d = find_domain(ip);
- + struct subnet_record *mydomain = find_domain(*iface_bcast(ip));
- char *name = buf;
- struct work_record *work;
- name[15] = 0;
- @@ -597,7 +596,7 @@
- for (buf1 = buf+5; *buf1 && count; buf1 = skip_string(buf1, 1), --count)
- {
- struct in_addr back_ip;
- - struct domain_record *d;
- + struct subnet_record *d;
-
- DEBUG(4,("Searching for backup browser %s at %s...\n",
- buf1, inet_ntoa(ip)));
- @@ -616,8 +615,8 @@
-
- if ((d = find_domain(back_ip)))
- {
- - struct domain_record *d1;
- - for (d1 = domainlist; d1; d1 = d1->next)
- + struct subnet_record *d1;
- + for (d1 = subnetlist; d1; d1 = d1->next)
- {
- struct work_record *work;
- for (work = d1->workgrouplist; work; work = work->next)
- @@ -651,7 +650,7 @@
- {
- struct dgram_packet *dgram = &p->packet.dgram;
- struct in_addr ip = dgram->header.source_ip;
- - struct domain_record *d;
- + struct subnet_record *d;
- struct work_record *work;
-
- int count = CVAL(buf,0);
- @@ -669,7 +668,7 @@
- return;
- }
-
- - for (d = domainlist; d; d = d->next)
- + for (d = subnetlist; d; d = d->next)
- {
- for (work = d->workgrouplist; work; work = work->next)
- {
- @@ -707,8 +706,8 @@
- /* stop being a master but still deal with being a backup browser */
- if (state & 0x1)
- {
- - struct domain_record *d;
- - for (d = domainlist; d; d = d->next)
- + struct subnet_record *d;
- + for (d = subnetlist; d; d = d->next)
- {
- struct work_record *work;
- for (work = d->workgrouplist; work; work = work->next)
- @@ -724,8 +723,8 @@
- /* totally delete all servers and start afresh */
- if (state & 0x2)
- {
- - struct domain_record *d;
- - for (d = domainlist; d; d = d->next)
- + struct subnet_record *d;
- + for (d = subnetlist; d; d = d->next)
- {
- struct work_record *work;
- for (work=d->workgrouplist;work;work=remove_workgroup(d,work));
- @@ -752,7 +751,7 @@
- struct dgram_packet *dgram = &p->packet.dgram;
- struct work_record *work;
- struct in_addr ip = dgram->header.source_ip;
- - struct domain_record *d = find_domain(ip);
- + struct subnet_record *d = find_domain(ip);
- int token = CVAL(buf,0);
- char *name = buf+1;
-
- @@ -765,7 +764,7 @@
-
- if (!d) return;
-
- - if (!ismybcast(d->bcast_ip)) return;
- + if (!d->my_interface) return;
-
- for (work = d->workgrouplist; work; work = work->next)
- {
- @@ -784,7 +783,7 @@
- {
- struct dgram_packet *dgram = &p->packet.dgram;
- struct in_addr ip = dgram->header.source_ip;
- - struct domain_record *d = find_domain(ip);
- + struct subnet_record *d = find_domain(ip);
- char *logname,*q;
- char *reply_name;
- BOOL add_slashes = False;
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/nmbd.c samba-1.9.16alpha10/source/nmbd.c
- --- samba-1.9.16alpha9/source/nmbd.c Sat Jun 8 15:37:54 1996
- +++ samba-1.9.16alpha10/source/nmbd.c Mon Jun 10 15:18:56 1996
- @@ -26,7 +26,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int DEBUGLEVEL;
-
- @@ -287,7 +286,7 @@
- ipmask = *iface_nmask(ipaddr);
-
- if (group) {
- - add_domain_entry(ipaddr, ipmask, name, True);
- + add_subnet_entry(ipaddr, ipmask, name, True);
- } else {
- add_netbios_entry(name,0x20,NB_ACTIVE,0,source,ipaddr,True);
- }
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/nmblib.c samba-1.9.16alpha10/source/nmblib.c
- --- samba-1.9.16alpha9/source/nmblib.c Thu Jun 6 21:57:22 1996
- +++ samba-1.9.16alpha10/source/nmblib.c Mon Jun 10 15:18:57 1996
- @@ -21,7 +21,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int DEBUGLEVEL;
-
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/nmbsync.c samba-1.9.16alpha10/source/nmbsync.c
- --- samba-1.9.16alpha9/source/nmbsync.c Fri Jun 7 15:36:53 1996
- +++ samba-1.9.16alpha10/source/nmbsync.c Mon Jun 10 15:18:57 1996
- @@ -21,7 +21,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int ClientNMB;
- extern int ClientDGRAM;
- @@ -55,7 +54,7 @@
- /****************************************************************************
- adds information retrieved from a NetServerEnum call
- ****************************************************************************/
- -static BOOL add_info(struct domain_record *d, struct work_record *work, int servertype)
- +static BOOL add_info(struct subnet_record *d, struct work_record *work, int servertype)
- {
- char *rparam = NULL;
- char *rdata = NULL;
- @@ -112,7 +111,7 @@
- /* creates workgroup on remote subnet */
- if ((w = find_workgroupstruct(d,sname, True)))
- {
- - if (ismybcast(d->bcast_ip))
- + if (d->my_interface)
- {
- announce_request(w, d->bcast_ip);
- }
- @@ -141,7 +140,7 @@
- void sync_browse_lists(struct work_record *work, char *name, int nm_type,
- struct in_addr ip)
- {
- - struct domain_record *d;
- + struct subnet_record *d;
- pid = getpid();
- uid = getuid();
- gid = getgid();
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/params.c samba-1.9.16alpha10/source/params.c
- --- samba-1.9.16alpha9/source/params.c Wed Jun 5 01:16:27 1996
- +++ samba-1.9.16alpha10/source/params.c Mon Jun 10 15:18:57 1996
- @@ -57,7 +57,6 @@
- #include "includes.h"
-
- #include "smb.h"
- -#include "params.h"
-
- /* local variable pointing to passed filename */
- static char *pszParmFile = NULL;
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/params.h samba-1.9.16alpha10/source/params.h
- --- samba-1.9.16alpha9/source/params.h Wed Jun 5 01:16:27 1996
- +++ samba-1.9.16alpha10/source/params.h Thu Jan 1 10:00:00 1970
- @@ -1,40 +0,0 @@
- -/*
- - Unix SMB/Netbios implementation.
- - Version 1.9.
- - Parameter loading utilities
- - Copyright (C) Karl Auer 1993, 1994
- -
- - This program is free software; you can redistribute it and/or modify
- - it under the terms of the GNU General Public License as published by
- - the Free Software Foundation; either version 2 of the License, or
- - (at your option) any later version.
- -
- - This program is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- - GNU General Public License for more details.
- -
- - You should have received a copy of the GNU General Public License
- - along with this program; if not, write to the Free Software
- - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- -*/
- -
- -/**************************************************************************
- -PARAMS.H
- -
- -Copyright (C) 1990, 1991, 1992 Karl Auer
- -
- -Prototypes and definitions for PARAMS.C.
- -**************************************************************************/
- -#ifndef _PARAMS_H
- -#define _PARAMS_H
- -
- -#include <stdio.h>
- -#include "smb.h"
- -
- -#define PM_NOFILE 1
- -#define PM_NOFILENAME 2
- -#define PM_FILEERROR 3
- -
- -#endif
- -
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/password.c samba-1.9.16alpha10/source/password.c
- --- samba-1.9.16alpha9/source/password.c Thu Jun 6 21:57:23 1996
- +++ samba-1.9.16alpha10/source/password.c Mon Jun 10 15:18:58 1996
- @@ -20,7 +20,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int DEBUGLEVEL;
- extern int Protocol;
- @@ -1319,9 +1318,10 @@
- CVAL(outbuf,0) = 0x81;
-
- send_smb(password_client,outbuf);
- - receive_smb(password_client,inbuf,5000);
- +
-
- - if (CVAL(inbuf,0) != 0x82) {
- + if (!receive_smb(password_client,inbuf,5000) ||
- + CVAL(inbuf,0) != 0x82) {
- DEBUG(1,("%s rejected the session\n",pserver));
- close(password_client); password_client = -1;
- return(False);
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/pcap.c samba-1.9.16alpha10/source/pcap.c
- --- samba-1.9.16alpha9/source/pcap.c Sat May 4 17:50:24 1996
- +++ samba-1.9.16alpha10/source/pcap.c Mon Jun 10 15:18:58 1996
- @@ -54,8 +54,6 @@
- #include "includes.h"
-
- #include "smb.h"
- -#include "loadparm.h"
- -#include "pcap.h"
-
- extern int DEBUGLEVEL;
-
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/pcap.h samba-1.9.16alpha10/source/pcap.h
- --- samba-1.9.16alpha9/source/pcap.h Sat May 4 17:50:24 1996
- +++ samba-1.9.16alpha10/source/pcap.h Thu Jan 1 10:00:00 1970
- @@ -1,35 +0,0 @@
- -/*
- - Unix SMB/Netbios implementation.
- - Version 1.9.
- - printcap parsing
- - Copyright (C) Karl Auer 1993, 1994
- -
- - This program is free software; you can redistribute it and/or modify
- - it under the terms of the GNU General Public License as published by
- - the Free Software Foundation; either version 2 of the License, or
- - (at your option) any later version.
- -
- - This program is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- - GNU General Public License for more details.
- -
- - You should have received a copy of the GNU General Public License
- - along with this program; if not, write to the Free Software
- - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- -*/
- -
- -/*
- - *
- - * Prototypes etc for pcap.c.
- - *
- - */
- -#ifndef _PCAP_H
- -#define _PCAP_H
- -
- -#include "smb.h"
- -
- -extern BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname);
- -extern void pcap_printer_fn(void (*fn)());
- -
- -#endif
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/predict.c samba-1.9.16alpha10/source/predict.c
- --- samba-1.9.16alpha9/source/predict.c Fri Jun 7 13:33:59 1996
- +++ samba-1.9.16alpha10/source/predict.c Mon Jun 10 15:18:59 1996
- @@ -20,7 +20,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int DEBUGLEVEL;
-
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/printing.c samba-1.9.16alpha10/source/printing.c
- --- samba-1.9.16alpha9/source/printing.c Sat Jun 1 01:15:12 1996
- +++ samba-1.9.16alpha10/source/printing.c Mon Jun 10 15:18:59 1996
- @@ -20,7 +20,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
- extern int DEBUGLEVEL;
- extern connection_struct Connections[];
- extern files_struct Files[];
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/proto.h samba-1.9.16alpha10/source/proto.h
- --- samba-1.9.16alpha9/source/proto.h Sat Jun 8 15:37:54 1996
- +++ samba-1.9.16alpha10/source/proto.h Mon Jun 10 15:18:59 1996
- @@ -1,3 +1,4 @@
- +/* This file is automatically generated with "make proto". DO NOT EDIT */
- BOOL check_access(int snum);
- BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client);
- BOOL fromhost(int sock,struct from_host *f);
- @@ -75,6 +76,123 @@
- int reply_trans(char *inbuf,char *outbuf);
- int interpret_coding_system(char *str, int def);
- char *lp_string(char *s);
- +char *lp_logfile(void);
- +char *lp_smbrun(void);
- +char *lp_configfile(void);
- +char *lp_smb_passwd_file(void);
- +char *lp_serverstring(void);
- +char *lp_printcapname(void);
- +char *lp_lockdir(void);
- +char *lp_rootdir(void);
- +char *lp_defaultservice(void);
- +char *lp_msg_command(void);
- +char *lp_dfree_command(void);
- +char *lp_hosts_equiv(void);
- +char *lp_auto_services(void);
- +char *lp_passwd_program(void);
- +char *lp_passwd_chat(void);
- +char *lp_passwordserver(void);
- +char *lp_workgroup(void);
- +char *lp_domain_controller(void);
- +char *lp_username_map(void);
- +char *lp_character_set(void);
- +char *lp_logon_script(void);
- +char *lp_wins_server(void);
- +char *lp_interfaces(void);
- +BOOL lp_wins_support(void);
- +BOOL lp_wins_proxy(void);
- +BOOL lp_domain_master(void);
- +BOOL lp_domain_logons(void);
- +BOOL lp_preferred_master(void);
- +BOOL lp_load_printers(void);
- +BOOL lp_use_rhosts(void);
- +BOOL lp_getwdcache(void);
- +BOOL lp_readprediction(void);
- +BOOL lp_readbmpx(void);
- +BOOL lp_readraw(void);
- +BOOL lp_writeraw(void);
- +BOOL lp_null_passwords(void);
- +BOOL lp_strip_dot(void);
- +BOOL lp_encrypted_passwords(void);
- +BOOL lp_syslog_only(void);
- +BOOL lp_browse_list(void);
- +int lp_os_level(void);
- +int lp_max_ttl(void);
- +int lp_max_log_size(void);
- +int lp_mangledstack(void);
- +int lp_maxxmit(void);
- +int lp_maxmux(void);
- +int lp_maxpacket(void);
- +int lp_keepalive(void);
- +int lp_passwordlevel(void);
- +int lp_readsize(void);
- +int lp_deadtime(void);
- +int lp_maxprotocol(void);
- +int lp_security(void);
- +int lp_printing(void);
- +int lp_maxdisksize(void);
- +int lp_lpqcachetime(void);
- +int lp_syslog(void);
- +char *lp_preexec(int );
- +char *lp_postexec(int );
- +char *lp_rootpreexec(int );
- +char *lp_rootpostexec(int );
- +char *lp_servicename(int );
- +char *lp_pathname(int );
- +char *lp_dontdescend(int );
- +char *lp_username(int );
- +char *lp_guestaccount(int );
- +char *lp_invalid_users(int );
- +char *lp_valid_users(int );
- +char *lp_admin_users(int );
- +char *lp_printcommand(int );
- +char *lp_lpqcommand(int );
- +char *lp_lprmcommand(int );
- +char *lp_lppausecommand(int );
- +char *lp_lpresumecommand(int );
- +char *lp_printername(int );
- +char *lp_hostsallow(int );
- +char *lp_hostsdeny(int );
- +char *lp_magicscript(int );
- +char *lp_magicoutput(int );
- +char *lp_comment(int );
- +char *lp_force_user(int );
- +char *lp_force_group(int );
- +char *lp_readlist(int );
- +char *lp_writelist(int );
- +char *lp_volume(int );
- +char *lp_mangled_map(int );
- +BOOL lp_alternate_permissions(int );
- +BOOL lp_revalidate(int );
- +BOOL lp_casesensitive(int );
- +BOOL lp_preservecase(int );
- +BOOL lp_shortpreservecase(int );
- +BOOL lp_casemangle(int );
- +BOOL lp_status(int );
- +BOOL lp_hide_dot_files(int );
- +BOOL lp_browseable(int );
- +BOOL lp_readonly(int );
- +BOOL lp_no_set_dir(int );
- +BOOL lp_guest_ok(int );
- +BOOL lp_guest_only(int );
- +BOOL lp_print_ok(int );
- +BOOL lp_postscript(int );
- +BOOL lp_map_hidden(int );
- +BOOL lp_map_archive(int );
- +BOOL lp_locking(int );
- +BOOL lp_strict_locking(int );
- +BOOL lp_share_modes(int );
- +BOOL lp_onlyuser(int );
- +BOOL lp_manglednames(int );
- +BOOL lp_widelinks(int );
- +BOOL lp_syncalways(int );
- +BOOL lp_map_system(int );
- +BOOL lp_delete_readonly(int );
- +int lp_create_mode(int );
- +int lp_max_connections(int );
- +int lp_defaultcase(int );
- +int lp_minprintspace(int );
- +char lp_magicchar(int );
- BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir);
- int lp_add_service(char *pszService, int iDefaultService);
- BOOL lp_add_printer(char *pszPrintername, int iDefaultService);
- @@ -88,6 +206,9 @@
- int lp_servicenumber(char *pszServiceName);
- char *my_workgroup(void);
- char *volume_label(int snum);
- +BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type);
- +int file_lock(char *name,int timeout);
- +void file_unlock(int fd);
- BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset);
- BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode);
- BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode);
- @@ -115,19 +236,19 @@
- void announce_backup(void);
- void announce_host(void);
- void announce_master(void);
- -struct work_record *remove_workgroup(struct domain_record *d,
- +struct work_record *remove_workgroup(struct subnet_record *d,
- struct work_record *work);
- void expire_browse_cache(time_t t);
- -struct work_record *find_workgroupstruct(struct domain_record *d,
- +struct work_record *find_workgroupstruct(struct subnet_record *d,
- fstring name, BOOL add);
- -struct domain_record *find_domain(struct in_addr source_ip);
- +struct subnet_record *find_domain(struct in_addr ip);
- void dump_workgroups(void);
- -struct domain_record *add_domain_entry(struct in_addr source_ip,
- +struct subnet_record *add_subnet_entry(struct in_addr source_ip,
- struct in_addr source_mask,
- char *name, BOOL add);
- struct browse_cache_record *add_browser_entry(char *name, int type, char *wg,
- time_t ttl, struct in_addr ip);
- -struct server_record *add_server_entry(struct domain_record *d,
- +struct server_record *add_server_entry(struct subnet_record *d,
- struct work_record *work,
- char *name,int servertype,
- int ttl,char *comment,
- @@ -136,9 +257,9 @@
- void expire_servers(time_t t);
- void check_master_browser(void);
- void browser_gone(char *work_name, struct in_addr ip);
- -void send_election(struct domain_record *d, char *group,uint32 criterion,
- +void send_election(struct subnet_record *d, char *group,uint32 criterion,
- int timeup,char *name);
- -void become_nonmaster(struct domain_record *d, struct work_record *work);
- +void become_nonmaster(struct subnet_record *d, struct work_record *work);
- void run_elections(void);
- void process_election(struct packet_struct *p,char *buf);
- BOOL check_elections(void);
- @@ -254,6 +375,13 @@
- BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
- BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
- BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
- +char *Strstr(char *s, char *p);
- +time_t Mktime(struct tm *t);
- +int InNetGr(char *group,char *host,char *user,char *dom);
- +void *malloc_wrapped(int size,char *file,int line);
- +void *realloc_wrapped(void *ptr,int size,char *file,int line);
- +void free_wrapped(void *ptr,char *file,int line);
- +void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line);
- int reply_special(char *inbuf,char *outbuf);
- int reply_tcon(char *inbuf,char *outbuf);
- int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize);
- @@ -402,9 +530,6 @@
- BOOL user_in_list(char *user,char *list);
- void setup_logging(char *pname,BOOL interactive);
- void reopen_logs(void);
- -BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type);
- -int file_lock(char *name,int timeout);
- -void file_unlock(int fd);
- BOOL is_a_socket(int fd);
- BOOL next_token(char **ptr,char *buff,char *sep);
- char **toktocliplist(int *ctok, char *sep);
- @@ -509,13 +634,6 @@
- void BlockSignals(BOOL block);
- void ajt_panic(void);
- char *readdirname(void *p);
- -void *malloc_wrapped(int size,char *file,int line);
- -void *realloc_wrapped(void *ptr,int size,char *file,int line);
- -void free_wrapped(void *ptr,char *file,int line);
- -char *Strstr(char *s, char *p);
- -time_t Mktime(struct tm *t);
- -int InNetGr(char *group,char *host,char *user,char *dom);
- -void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line);
- int VT_Check(char *buffer);
- int VT_Start_utmp(void);
- int VT_Stop_utmp(void);
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/quotas.c samba-1.9.16alpha10/source/quotas.c
- --- samba-1.9.16alpha9/source/quotas.c Sat Jun 8 15:37:54 1996
- +++ samba-1.9.16alpha10/source/quotas.c Mon Jun 10 15:18:59 1996
- @@ -273,7 +273,7 @@
- return(False) ;
-
- devno = sbuf.st_dev ;
- -DEBUG(5,("disk_quotas: looking for path \"%s\" devno=%o\n", path,devno));
- + DEBUG(5,("disk_quotas: looking for path \"%s\" devno=%o\n", path,devno));
- if ( devno != devno_cached ) {
- devno_cached = devno ;
- #if defined(SUNOS5)
- @@ -284,7 +284,8 @@
- while (getmntent(fd, &mnt) == 0) {
- if ( stat(mnt.mnt_mountp,&sbuf) == -1 )
- continue ;
- -DEBUG(5,("disk_quotas: testing \"%s\" devno=%o\n", mnt.mnt_mountp,sbuf.st_dev));
- + DEBUG(5,("disk_quotas: testing \"%s\" devno=%o\n",
- + mnt.mnt_mountp,sbuf.st_dev));
- if (sbuf.st_dev == devno) {
- found = True ;
- break ;
- @@ -302,7 +303,8 @@
- while ((mnt = getmntent(fd)) != NULL) {
- if ( stat(mnt->mnt_dir,&sbuf) == -1 )
- continue ;
- -DEBUG(5,("disk_quotas: testing \"%s\" devno=%o\n", mnt->mnt_dir,sbuf.st_dev));
- + DEBUG(5,("disk_quotas: testing \"%s\" devno=%o\n",
- + mnt->mnt_dir,sbuf.st_dev));
- if (sbuf.st_dev == devno) {
- found = True ;
- break ;
- @@ -324,7 +326,7 @@
- seteuid(0);
-
- #if defined(SUNOS5)
- -DEBUG(5,("disk_quotas: looking for quotas file \"%s\"\n", name));
- + DEBUG(5,("disk_quotas: looking for quotas file \"%s\"\n", name));
- if((file=open(name, O_RDONLY))<0) {
- setuid(user_id); /* Restore the original UID status */
- seteuid(euser_id);
- @@ -336,7 +338,7 @@
- ret = ioctl(file, Q_QUOTACTL, &command);
- close(file);
- #else
- -DEBUG(5,("disk_quotas: trying quotactl on device \"%s\"\n", name));
- + DEBUG(5,("disk_quotas: trying quotactl on device \"%s\"\n", name));
- ret = quotactl(Q_GETQUOTA, name, euser_id, &D);
- #endif
-
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/replace.c samba-1.9.16alpha10/source/replace.c
- --- samba-1.9.16alpha9/source/replace.c Thu Jan 1 10:00:00 1970
- +++ samba-1.9.16alpha10/source/replace.c Mon Jun 10 13:39:38 1996
- @@ -0,0 +1,322 @@
- +/*
- + Unix SMB/Netbios implementation.
- + Version 1.9.
- + replacement routines for broken systems
- + Copyright (C) Andrew Tridgell 1992-1995
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (at your option) any later version.
- +
- + This program is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + GNU General Public License for more details.
- +
- + You should have received a copy of the GNU General Public License
- + along with this program; if not, write to the Free Software
- + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- +*/
- +
- +#include "includes.h"
- +
- + void replace_dummy(void)
- +{}
- +
- +#ifdef REPLACE_STRLEN
- +/****************************************************************************
- +a replacement strlen() that returns int for solaris
- +****************************************************************************/
- + int Strlen(char *s)
- +{
- + int ret=0;
- + if (!s) return(0);
- + while (*s++) ret++;
- + return(ret);
- +}
- +#endif
- +
- +#ifdef NO_FTRUNCATE
- + /*******************************************************************
- +ftruncate for operating systems that don't have it
- +********************************************************************/
- + int ftruncate(int f,long l)
- +{
- + struct flock fl;
- +
- + fl.l_whence = 0;
- + fl.l_len = 0;
- + fl.l_start = l;
- + fl.l_type = F_WRLCK;
- + return fcntl(f, F_FREESP, &fl);
- +}
- +#endif
- +
- +
- +#ifdef REPLACE_STRSTR
- +/****************************************************************************
- +Mips version of strstr doesn't seem to work correctly.
- +There is a #define in includes.h to redirect calls to this function.
- +****************************************************************************/
- +char *Strstr(char *s, char *p)
- +{
- + int len = strlen(p);
- +
- + while ( *s != '\0' ) {
- + if ( strncmp(s, p, len) == 0 )
- + return s;
- + s++;
- + }
- +
- + return NULL;
- +}
- +#endif /* REPLACE_STRSTR */
- +
- +
- +#ifdef REPLACE_MKTIME
- +/*******************************************************************
- +a mktime() replacement for those who don't have it - contributed by
- +C.A. Lademann <cal@zls.com>
- +********************************************************************/
- +#define MINUTE 60
- +#define HOUR 60*MINUTE
- +#define DAY 24*HOUR
- +#define YEAR 365*DAY
- +time_t Mktime(struct tm *t)
- +{
- + struct tm *u;
- + time_t epoch = 0;
- + int mon [] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
- + y, m, i;
- +
- + if(t->tm_year < 70)
- + return((time_t)-1);
- +
- + epoch = (t->tm_year - 70) * YEAR +
- + (t->tm_year / 4 - 70 / 4 - t->tm_year / 100) * DAY;
- +
- + y = t->tm_year;
- + m = 0;
- +
- + for(i = 0; i < t->tm_mon; i++) {
- + epoch += mon [m] * DAY;
- + if(m == 1 && y % 4 == 0 && (y % 100 != 0 || y % 400 == 0))
- + epoch += DAY;
- +
- + if(++m > 11) {
- + m = 0;
- + y++;
- + }
- + }
- +
- + epoch += (t->tm_mday - 1) * DAY;
- + epoch += t->tm_hour * HOUR + t->tm_min * MINUTE + t->tm_sec;
- +
- + if((u = localtime(&epoch)) != NULL) {
- + t->tm_sec = u->tm_sec;
- + t->tm_min = u->tm_min;
- + t->tm_hour = u->tm_hour;
- + t->tm_mday = u->tm_mday;
- + t->tm_mon = u->tm_mon;
- + t->tm_year = u->tm_year;
- + t->tm_wday = u->tm_wday;
- + t->tm_yday = u->tm_yday;
- + t->tm_isdst = u->tm_isdst;
- +#ifndef NO_TM_NAME
- + memcpy(t->tm_name, u->tm_name, LTZNMAX);
- +#endif
- + }
- +
- + return(epoch);
- +}
- +#endif /* REPLACE_MKTIME */
- +
- +
- +
- +#ifdef REPLACE_RENAME
- +/* Rename a file. (from libiberty in GNU binutils) */
- + int rename (zfrom, zto)
- + const char *zfrom;
- + const char *zto;
- +{
- + if (link (zfrom, zto) < 0)
- + {
- + if (errno != EEXIST)
- + return -1;
- + if (unlink (zto) < 0
- + || link (zfrom, zto) < 0)
- + return -1;
- + }
- + return unlink (zfrom);
- +}
- +#endif
- +
- +
- +#ifdef REPLACE_INNETGR
- +/*
- + * Search for a match in a netgroup. This replaces it on broken systems.
- + */
- +int InNetGr(char *group,char *host,char *user,char *dom)
- +{
- + char *hst, *usr, *dm;
- +
- + setnetgrent(group);
- + while (getnetgrent(&hst, &usr, &dm))
- + if (((host == 0) || (hst == 0) || !strcmp(host, hst)) &&
- + ((user == 0) || (usr == 0) || !strcmp(user, usr)) &&
- + ((dom == 0) || (dm == 0) || !strcmp(dom, dm))) {
- + endnetgrent();
- + return (1);
- + }
- + endnetgrent();
- + return (0);
- +}
- +#endif
- +
- +
- +
- +#ifdef NO_INITGROUPS
- +#include <sys/types.h>
- +#include <limits.h>
- +#include <grp.h>
- +
- +#ifndef NULL
- +#define NULL (void *)0
- +#endif
- +
- +/****************************************************************************
- + some systems don't have an initgroups call
- +****************************************************************************/
- + int initgroups(char *name,gid_t id)
- +{
- +#ifdef NO_SETGROUPS
- + /* yikes! no SETGROUPS or INITGROUPS? how can this work? */
- + return(0);
- +#else
- + gid_t grouplst[NGROUPS_MAX];
- + int i,j;
- + struct group *g;
- + char *gr;
- +
- + grouplst[0] = id;
- + i = 1;
- + while (i < NGROUPS_MAX &&
- + ((g = (struct group *)getgrent()) != (struct group *)NULL))
- + {
- + if (g->gr_gid == id)
- + continue;
- + j = 0;
- + gr = g->gr_mem[0];
- + while (gr && (*gr != (char)NULL)) {
- + if (strcmp(name,gr) == 0) {
- + grouplst[i] = g->gr_gid;
- + i++;
- + gr = (char *)NULL;
- + break;
- + }
- + gr = g->gr_mem[++j];
- + }
- + }
- + endgrent();
- + return(setgroups(i,grouplst));
- +#endif
- +}
- +#endif
- +
- +
- +#if (defined(SecureWare) && defined(SCO))
- +/* This is needed due to needing the nap() function but we don't want
- + to include the Xenix libraries since that will break other things...
- + BTW: system call # 0x0c28 is the same as calling nap() */
- +long nap(long milliseconds) {
- + return syscall(0x0c28, milliseconds);
- +}
- +#endif
- +
- +
- +
- +#if WRAP_MALLOC
- +
- +/* undo the wrapping temporarily */
- +#undef malloc
- +#undef realloc
- +#undef free
- +
- +/****************************************************************************
- +wrapper for malloc() to catch memory errors
- +****************************************************************************/
- +void *malloc_wrapped(int size,char *file,int line)
- +{
- +#ifdef xx_old_malloc
- + void *res = xx_old_malloc(size);
- +#else
- + void *res = malloc(size);
- +#endif
- + DEBUG(3,("Malloc called from %s(%d) with size=%d gave ptr=0x%X\n",
- + file,line,
- + size,(unsigned int)res));
- + return(res);
- +}
- +
- +/****************************************************************************
- +wrapper for realloc() to catch memory errors
- +****************************************************************************/
- +void *realloc_wrapped(void *ptr,int size,char *file,int line)
- +{
- +#ifdef xx_old_realloc
- + void *res = xx_old_realloc(ptr,size);
- +#else
- + void *res = realloc(ptr,size);
- +#endif
- + DEBUG(3,("Realloc\n"));
- + DEBUG(3,("free called from %s(%d) with ptr=0x%X\n",
- + file,line,
- + (unsigned int)ptr));
- + DEBUG(3,("Malloc called from %s(%d) with size=%d gave ptr=0x%X\n",
- + file,line,
- + size,(unsigned int)res));
- + return(res);
- +}
- +
- +/****************************************************************************
- +wrapper for free() to catch memory errors
- +****************************************************************************/
- +void free_wrapped(void *ptr,char *file,int line)
- +{
- +#ifdef xx_old_free
- + xx_old_free(ptr);
- +#else
- + free(ptr);
- +#endif
- + DEBUG(3,("free called from %s(%d) with ptr=0x%X\n",
- + file,line,(unsigned int)ptr));
- + return;
- +}
- +
- +/* and re-do the define for spots lower in this file */
- +#define malloc(size) malloc_wrapped(size,__FILE__,__LINE__)
- +#define realloc(ptr,size) realloc_wrapped(ptr,size,__FILE__,__LINE__)
- +#define free(ptr) free_wrapped(ptr,__FILE__,__LINE__)
- +
- +#endif
- +
- +
- +#if WRAP_MEMCPY
- +#undef memcpy
- +/*******************************************************************
- +a wrapper around memcpy for diagnostic purposes
- +********************************************************************/
- +void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line)
- +{
- + if (l>64 && (((int)d)%4) != (((int)s)%4))
- + DEBUG(4,("Misaligned memcpy(0x%X,0x%X,%d) at %s(%d)\n",d,s,l,fname,line));
- +#ifdef xx_old_memcpy
- + return(xx_old_memcpy(d,s,l));
- +#else
- + return(memcpy(d,s,l));
- +#endif
- +}
- +#define memcpy(d,s,l) memcpy_wrapped(d,s,l,__FILE__,__LINE__)
- +#endif
- +
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/reply.c samba-1.9.16alpha10/source/reply.c
- --- samba-1.9.16alpha9/source/reply.c Wed Jun 5 01:16:28 1996
- +++ samba-1.9.16alpha10/source/reply.c Mon Jun 10 15:19:00 1996
- @@ -25,7 +25,6 @@
-
-
- #include "includes.h"
- -#include "loadparm.h"
- #include "trans2.h"
-
- /* look in server.c for some explanation of these variables */
- @@ -1591,7 +1590,7 @@
- send_smb(Client,outbuf);
-
- /* Now read the raw data into the buffer and write it */
- - if(read_smb_length(Client,inbuf,0) == -1) {
- + if (read_smb_length(Client,inbuf,SMB_SECONDARY_WAIT) == -1) {
- exit_server("secondary writebraw failed");
- }
-
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/reply.h samba-1.9.16alpha10/source/reply.h
- --- samba-1.9.16alpha9/source/reply.h Sat May 4 17:50:24 1996
- +++ samba-1.9.16alpha10/source/reply.h Thu Jan 1 10:00:00 1970
- @@ -1,60 +0,0 @@
- -int reply_special(char *inbuf,char *outbuf);
- -int reply_corep(char *outbuf);
- -int reply_coreplus(char *outbuf);
- -int reply_nt1(char *outbuf);
- -int reply_lanman1(char *outbuf);
- -int reply_lanman2(char *outbuf);
- -int reply_tcon(char *inbuf,char *outbuf);
- -int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize);
- -int reply_unknown(char *inbuf,char *outbuf);
- -int reply_ioctl(char *inbuf,char *outbuf);
- -int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize);
- -int reply_chkpth(char *inbuf,char *outbuf);
- -int reply_getatr(char *inbuf,char *outbuf);
- -int reply_setatr(char *inbuf,char *outbuf);
- -int reply_dskattr(char *inbuf,char *outbuf);
- -int reply_search(char *inbuf,char *outbuf);
- -int reply_fclose(char *inbuf,char *outbuf);
- -int reply_open(char *inbuf,char *outbuf);
- -int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize);
- -int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize);
- -int reply_mknew(char *inbuf,char *outbuf);
- -int reply_ctemp(char *inbuf,char *outbuf);
- -int reply_unlink(char *inbuf,char *outbuf);
- -int reply_readbraw(char *inbuf, char *outbuf);
- -int reply_lockread(char *inbuf,char *outbuf);
- -int reply_read(char *inbuf,char *outbuf);
- -int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize);
- -int reply_writebraw(char *inbuf,char *outbuf);
- -int reply_writeunlock(char *inbuf,char *outbuf);
- -int reply_write(char *inbuf,char *outbuf,int dum1,int dum2);
- -int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize);
- -int reply_lseek(char *inbuf,char *outbuf);
- -int reply_flush(char *inbuf,char *outbuf);
- -int reply_exit(char *inbuf,char *outbuf);
- -int reply_close(char *inbuf,char *outbuf);
- -int reply_writeclose(char *inbuf,char *outbuf);
- -int reply_lock(char *inbuf,char *outbuf);
- -int reply_unlock(char *inbuf,char *outbuf);
- -int reply_tdis(char *inbuf,char *outbuf);
- -int reply_echo(char *inbuf,char *outbuf);
- -int reply_printopen(char *inbuf,char *outbuf);
- -int reply_printclose(char *inbuf,char *outbuf);
- -int reply_printqueue(char *inbuf,char *outbuf);
- -int reply_printwrite(char *inbuf,char *outbuf);
- -int reply_mkdir(char *inbuf,char *outbuf);
- -int reply_rmdir(char *inbuf,char *outbuf);
- -int reply_mv(char *inbuf,char *outbuf);
- -int reply_copy(char *inbuf,char *outbuf);
- -int reply_setdir(char *inbuf,char *outbuf);
- -int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize);
- -int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize);
- -int reply_writebmpx(char *inbuf,char *outbuf);
- -int reply_setattrE(char *inbuf,char *outbuf);
- -int reply_getattrE(char *inbuf,char *outbuf);
- -int reply_writebs(char *inbuf,char *outbuf);
- -int reply_sends(char *inbuf,char *outbuf);
- -int reply_sendstrt(char *inbuf,char *outbuf);
- -int reply_sendend(char *inbuf,char *outbuf);
- -int reply_sendtxt(char *inbuf,char *outbuf);
- -int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize);
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/server.c samba-1.9.16alpha10/source/server.c
- --- samba-1.9.16alpha9/source/server.c Thu Jun 6 21:57:24 1996
- +++ samba-1.9.16alpha10/source/server.c Mon Jun 10 15:19:01 1996
- @@ -20,10 +20,7 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
- -#include "pcap.h"
- #include "trans2.h"
- -#include "reply.h"
-
- pstring servicesf = CONFIGFILE;
- extern pstring debugf;
- @@ -3447,6 +3444,27 @@
- }
-
- t = time(NULL);
- +
- + {
- + /* the following bit of code was added to combat smbd
- + looping chewing lots of CPU time. It should never
- + actually be needed, but it seems that some systems
- + don't set error correctly, which is used to distinguish
- + a select() timeout from a read error
- +
- + we exit if receive_smb() returns false 3 times in one second.
- + */
- + static int error_count=0;
- + static time_t error_time=0;
- + if (error_count==0) {
- + error_time = t;
- + } else if (error_time != t) {
- + error_count = 0;
- + } else if (error_count++ > 2) {
- + exit_server("looping in process()\n");
- + }
- + }
- +
-
- /* become root again if waiting */
- unbecome_user();
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/smb.h samba-1.9.16alpha10/source/smb.h
- --- samba-1.9.16alpha9/source/smb.h Wed Jun 5 01:16:29 1996
- +++ samba-1.9.16alpha10/source/smb.h Mon Jun 10 15:19:02 1996
- @@ -99,6 +99,9 @@
- #define DEFAULT_PIPE_TIMEOUT 10000000 /* Ten seconds */
- #endif
-
- +/* how long to wait for secondary SMB packets (seconds) */
- +#define SMB_SECONDARY_WAIT 30
- +
- /* debugging code */
- #ifndef SYSLOG
- #define DEBUG(level,body) ((DEBUGLEVEL>=(level))?(Debug1 body):0)
- @@ -232,6 +235,15 @@
- typedef char pstring[1024];
- typedef char fstring[128];
- typedef fstring string;
- +
- +
- +struct smb_passwd {
- + int smb_userid;
- + char *smb_name;
- + unsigned char *smb_passwd; /* Null if no password */
- + unsigned char *smb_nt_passwd; /* Null if no password */
- + /* Other fields / flags may be added later */
- +};
-
-
- struct current_user {
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/smbencrypt.c samba-1.9.16alpha10/source/smbencrypt.c
- --- samba-1.9.16alpha9/source/smbencrypt.c Wed Jun 5 01:16:29 1996
- +++ samba-1.9.16alpha10/source/smbencrypt.c Mon Jun 10 15:19:02 1996
- @@ -22,7 +22,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
- #include "des.h"
- #include "md4.h"
-
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/smbpass.c samba-1.9.16alpha10/source/smbpass.c
- --- samba-1.9.16alpha9/source/smbpass.c Wed Jun 5 01:16:29 1996
- +++ samba-1.9.16alpha10/source/smbpass.c Mon Jun 10 15:19:02 1996
- @@ -19,7 +19,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int DEBUGLEVEL;
-
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/smbpass.h samba-1.9.16alpha10/source/smbpass.h
- --- samba-1.9.16alpha9/source/smbpass.h Sat May 4 17:50:25 1996
- +++ samba-1.9.16alpha10/source/smbpass.h Thu Jan 1 10:00:00 1970
- @@ -1,50 +0,0 @@
- -#ifndef _SMBPASS_H_
- -#define _SMBPASS_H_
- -/*
- - Unix SMB/Netbios implementation.
- - Version 1.9.
- - SMB parameters and setup
- - Copyright (C) Jeremy Allison 1995
- -
- - This program is free software; you can redistribute it and/or modify
- - it under the terms of the GNU General Public License as published by
- - the Free Software Foundation; either version 2 of the License, or
- - (at your option) any later version.
- -
- - This program is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- - GNU General Public License for more details.
- -
- - You should have received a copy of the GNU General Public License
- - along with this program; if not, write to the Free Software
- - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- -*/
- -
- -struct smb_passwd {
- - int smb_userid;
- - char *smb_name;
- - unsigned char *smb_passwd; /* Null if no password */
- - unsigned char *smb_nt_passwd; /* Null if no password */
- - /* Other fields / flags may be added later */
- -};
- -
- -/* Return a smb_passwd struct given a user name, 0 if fails. */
- -struct smb_passwd *get_smbpwnam(char *user);
- -
- -#ifndef uchar
- -#define uchar unsigned char
- -#endif
- -
- -/* SMB Encryption functions. */
- -void str_to_key(unsigned char *str,unsigned char *key);
- -void E_P16(uchar *p14,uchar *p16);
- -void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24);
- -void E_md4hash(uchar *passwd,uchar *p16);
- -void SMBencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24);
- -void SMB_nt_encrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24);
- -
- -/* Password file lock/unlock routines */
- -int pw_file_lock(char *name, int type, int secs);
- -int pw_file_unlock(int fd);
- -#endif
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/status.c samba-1.9.16alpha10/source/status.c
- --- samba-1.9.16alpha9/source/status.c Wed Jun 5 01:16:29 1996
- +++ samba-1.9.16alpha10/source/status.c Mon Jun 10 15:19:03 1996
- @@ -28,7 +28,6 @@
- #endif
-
- #include "includes.h"
- -#include "loadparm.h"
-
- struct connect_record crec;
- extern int DEBUGLEVEL;
- @@ -39,10 +38,6 @@
- int Ucrit_pid[100]; /* Ugly !!! */ /* added by OH */
- int Ucrit_MaxPid=0; /* added by OH */
- unsigned int Ucrit_IsActive = 0; /* added by OH */
- -void Ucrit_addUsername(pstring username); /* added by OH */
- -unsigned int Ucrit_checkUsername(pstring username); /* added by OH */
- -void Ucrit_addPid(int pid); /* added by OH */
- -unsigned int Ucrit_checkPid(int pid); /* added by OH */
-
- int main(int argc, char *argv[])
- {
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/testparm.c samba-1.9.16alpha10/source/testparm.c
- --- samba-1.9.16alpha9/source/testparm.c Wed Jun 5 01:16:29 1996
- +++ samba-1.9.16alpha10/source/testparm.c Mon Jun 10 15:19:03 1996
- @@ -34,8 +34,6 @@
-
- #include "includes.h"
- #include "smb.h"
- -#include "params.h"
- -#include "loadparm.h"
-
- /* these live in util.c */
- extern FILE *dbf;
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/testprns.c samba-1.9.16alpha10/source/testprns.c
- --- samba-1.9.16alpha9/source/testprns.c Sat Jun 1 01:15:13 1996
- +++ samba-1.9.16alpha10/source/testprns.c Mon Jun 10 15:19:03 1996
- @@ -33,7 +33,6 @@
-
- #include "includes.h"
- #include "smb.h"
- -#include "pcap.h"
-
- /* these live in util.c */
- extern FILE *dbf;
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/trans2.c samba-1.9.16alpha10/source/trans2.c
- --- samba-1.9.16alpha9/source/trans2.c Thu Jun 6 01:44:18 1996
- +++ samba-1.9.16alpha10/source/trans2.c Mon Jun 10 15:19:03 1996
- @@ -22,7 +22,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
- #include "trans2.h"
-
- extern int DEBUGLEVEL;
- @@ -1555,10 +1554,8 @@
-
- while( num_data_sofar < total_data || num_params_sofar < total_params)
- {
- - receive_smb(Client,inbuf, 0);
- -
- - /* Ensure this is still a trans2 packet (sanity check) */
- - if(CVAL(inbuf, smb_com) != SMBtranss2)
- + if(!receive_smb(Client,inbuf, SMB_SECONDARY_WAIT*1000) ||
- + CVAL(inbuf, smb_com) != SMBtranss2)
- {
- outsize = set_message(outbuf,0,0,True);
- DEBUG(2,("Invalid secondary trans2 packet\n"));
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/ufc.c samba-1.9.16alpha10/source/ufc.c
- --- samba-1.9.16alpha9/source/ufc.c Wed Jun 5 01:16:29 1996
- +++ samba-1.9.16alpha10/source/ufc.c Mon Jun 10 15:19:04 1996
- @@ -656,8 +656,6 @@
- return outbuf;
- }
-
- -ufc_long *_ufc_doit();
- -
- /*
- * UNIX crypt function
- */
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/uid.c samba-1.9.16alpha10/source/uid.c
- --- samba-1.9.16alpha9/source/uid.c Wed Jun 5 01:16:29 1996
- +++ samba-1.9.16alpha10/source/uid.c Mon Jun 10 15:19:04 1996
- @@ -20,7 +20,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- extern int DEBUGLEVEL;
-
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/username.c samba-1.9.16alpha10/source/username.c
- --- samba-1.9.16alpha9/source/username.c Sat May 4 17:50:25 1996
- +++ samba-1.9.16alpha10/source/username.c Mon Jun 10 15:19:04 1996
- @@ -20,7 +20,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
- extern int DEBUGLEVEL;
-
-
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/util.c samba-1.9.16alpha10/source/util.c
- --- samba-1.9.16alpha9/source/util.c Fri Jun 7 15:36:55 1996
- +++ samba-1.9.16alpha10/source/util.c Mon Jun 10 15:19:05 1996
- @@ -20,7 +20,6 @@
- */
-
- #include "includes.h"
- -#include "loadparm.h"
-
- pstring scope = "";
-
- @@ -267,136 +266,6 @@
- }
-
- /****************************************************************************
- -routine to do file locking
- -****************************************************************************/
- -BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type)
- -{
- -#if HAVE_FCNTL_LOCK
- - struct flock lock;
- - int ret;
- -
- -#if 1
- - uint32 mask = 0xC0000000;
- -
- - /* make sure the count is reasonable, we might kill the lockd otherwise */
- - count &= ~mask;
- -
- - /* the offset is often strange - remove 2 of its bits if either of
- - the top two bits are set. Shift the top ones by two bits. This
- - still allows OLE2 apps to operate, but should stop lockd from
- - dieing */
- - if ((offset & mask) != 0)
- - offset = (offset & ~mask) | ((offset & mask) >> 2);
- -#else
- - unsigned long mask = ((unsigned)1<<31);
- -
- - /* interpret negative counts as large numbers */
- - if (count < 0)
- - count &= ~mask;
- -
- - /* no negative offsets */
- - offset &= ~mask;
- -
- - /* count + offset must be in range */
- - while ((offset < 0 || (offset + count < 0)) && mask)
- - {
- - offset &= ~mask;
- - mask = mask >> 1;
- - }
- -#endif
- -
- -
- - DEBUG(5,("fcntl_lock %d %d %d %d %d\n",fd,op,(int)offset,(int)count,type));
- -
- - lock.l_type = type;
- - lock.l_whence = SEEK_SET;
- - lock.l_start = (int)offset;
- - lock.l_len = (int)count;
- - lock.l_pid = 0;
- -
- - errno = 0;
- -
- - ret = fcntl(fd,op,&lock);
- -
- - if (errno != 0)
- - DEBUG(3,("fcntl lock gave errno %d (%s)\n",errno,strerror(errno)));
- -
- - /* a lock query */
- - if (op == F_GETLK)
- - {
- - if ((ret != -1) &&
- - (lock.l_type != F_UNLCK) &&
- - (lock.l_pid != 0) &&
- - (lock.l_pid != getpid()))
- - {
- - DEBUG(3,("fd %d is locked by pid %d\n",fd,lock.l_pid));
- - return(True);
- - }
- -
- - /* it must be not locked or locked by me */
- - return(False);
- - }
- -
- - /* a lock set or unset */
- - if (ret == -1)
- - {
- - DEBUG(3,("lock failed at offset %d count %d op %d type %d (%s)\n",
- - offset,count,op,type,strerror(errno)));
- -
- - /* perhaps it doesn't support this sort of locking?? */
- - if (errno == EINVAL)
- - {
- - DEBUG(3,("locking not supported? returning True\n"));
- - return(True);
- - }
- -
- - return(False);
- - }
- -
- - /* everything went OK */
- - DEBUG(5,("Lock call successful\n"));
- -
- - return(True);
- -#else
- - return(False);
- -#endif
- -}
- -
- -/*******************************************************************
- -lock a file - returning a open file descriptor or -1 on failure
- -The timeout is in seconds. 0 means no timeout
- -********************************************************************/
- -int file_lock(char *name,int timeout)
- -{
- - int fd = open(name,O_RDWR|O_CREAT,0666);
- - time_t t=0;
- - if (fd < 0) return(-1);
- -
- -#if HAVE_FCNTL_LOCK
- - if (timeout) t = time(NULL);
- - while (!timeout || (time(NULL)-t < timeout)) {
- - if (fcntl_lock(fd,F_SETLK,0,1,F_WRLCK)) return(fd);
- - msleep(LOCK_RETRY_TIMEOUT);
- - }
- - return(-1);
- -#else
- - return(fd);
- -#endif
- -}
- -
- -/*******************************************************************
- -unlock a file locked by file_lock
- -********************************************************************/
- -void file_unlock(int fd)
- -{
- - if (fd<0) return;
- -#if HAVE_FCNTL_LOCK
- - fcntl_lock(fd,F_SETLK,0,1,F_UNLCK);
- -#endif
- - close(fd);
- -}
- -
- -/****************************************************************************
- determine if a file descriptor is in fact a socket
- ****************************************************************************/
- BOOL is_a_socket(int fd)
- @@ -2210,7 +2079,7 @@
-
- if (msg_type == 0x85)
- {
- - DEBUG(5,( "Got keepalive packet\n"));
- + DEBUG(5,("Got keepalive packet\n"));
- ok = False;
- }
- }
- @@ -2228,8 +2097,7 @@
- ****************************************************************************/
- BOOL receive_smb(int fd,char *buffer,int timeout)
- {
- - int len;
- - BOOL ok;
- + int len,ret;
-
- bzero(buffer,smb_size + 100);
-
- @@ -2238,18 +2106,16 @@
- return(False);
-
- if (len > BUFFER_SIZE) {
- - DEBUG(0,("Invalid packet length! (%d bytes)\n",len));
- + DEBUG(0,("Invalid packet length! (%d bytes).\n",len));
- if (len > BUFFER_SIZE + (SAFETY_MARGIN/2))
- exit(1);
- }
-
- - ok = (read_data(fd,buffer+4,len) == len);
- -
- - if (!ok)
- - {
- - close_sockets();
- - exit(1);
- - }
- + ret = read_data(fd,buffer+4,len);
- + if (ret != len) {
- + DEBUG(0,("ERROR: Invalid SMB length. Expected %d got %d\n",len,ret));
- + return False;
- + }
-
- return(True);
- }
- @@ -2915,39 +2781,6 @@
- exit(2);
- }
-
- -
- -#ifdef REPLACE_STRLEN
- -/****************************************************************************
- -a replacement strlen() that returns int for solaris
- -****************************************************************************/
- - int Strlen(char *s)
- -{
- - int ret=0;
- - if (!s) return(0);
- - while (*s++) ret++;
- - return(ret);
- -}
- -#endif
- -
- -
- -#ifdef NO_FTRUNCATE
- - /*******************************************************************
- -ftruncate for operating systems that don't have it
- -********************************************************************/
- - int ftruncate(int f,long l)
- -{
- - struct flock fl;
- -
- - fl.l_whence = 0;
- - fl.l_len = 0;
- - fl.l_start = l;
- - fl.l_type = F_WRLCK;
- - return fcntl(f, F_FREESP, &fl);
- -}
- -#endif
- -
- -
- -
- /****************************************************************************
- get my own name and IP
- ****************************************************************************/
- @@ -3448,270 +3281,6 @@
-
- return(dname);
- }
- -
- -
- -
- -#if (defined(SecureWare) && defined(SCO))
- -/* This is needed due to needing the nap() function but we don't want
- - to include the Xenix libraries since that will break other things...
- - BTW: system call # 0x0c28 is the same as calling nap() */
- -long nap(long milliseconds) {
- - return syscall(0x0c28, milliseconds);
- -}
- -#endif
- -
- -#ifdef NO_INITGROUPS
- -#include <sys/types.h>
- -#include <limits.h>
- -#include <grp.h>
- -
- -#ifndef NULL
- -#define NULL (void *)0
- -#endif
- -
- -/****************************************************************************
- - some systems don't have an initgroups call
- -****************************************************************************/
- - int initgroups(char *name,gid_t id)
- -{
- -#ifdef NO_SETGROUPS
- - /* yikes! no SETGROUPS or INITGROUPS? how can this work? */
- - return(0);
- -#else
- - gid_t grouplst[NGROUPS_MAX];
- - int i,j;
- - struct group *g;
- - char *gr;
- -
- - grouplst[0] = id;
- - i = 1;
- - while (i < NGROUPS_MAX &&
- - ((g = (struct group *)getgrent()) != (struct group *)NULL))
- - {
- - if (g->gr_gid == id)
- - continue;
- - j = 0;
- - gr = g->gr_mem[0];
- - while (gr && (*gr != (char)NULL)) {
- - if (strcmp(name,gr) == 0) {
- - grouplst[i] = g->gr_gid;
- - i++;
- - gr = (char *)NULL;
- - break;
- - }
- - gr = g->gr_mem[++j];
- - }
- - }
- - endgrent();
- - return(setgroups(i,grouplst));
- -#endif
- -}
- -#endif
- -
- -
- -#if WRAP_MALLOC
- -
- -/* undo the wrapping temporarily */
- -#undef malloc
- -#undef realloc
- -#undef free
- -
- -/****************************************************************************
- -wrapper for malloc() to catch memory errors
- -****************************************************************************/
- -void *malloc_wrapped(int size,char *file,int line)
- -{
- -#ifdef xx_old_malloc
- - void *res = xx_old_malloc(size);
- -#else
- - void *res = malloc(size);
- -#endif
- - DEBUG(3,("Malloc called from %s(%d) with size=%d gave ptr=0x%X\n",
- - file,line,
- - size,(unsigned int)res));
- - return(res);
- -}
- -
- -/****************************************************************************
- -wrapper for realloc() to catch memory errors
- -****************************************************************************/
- -void *realloc_wrapped(void *ptr,int size,char *file,int line)
- -{
- -#ifdef xx_old_realloc
- - void *res = xx_old_realloc(ptr,size);
- -#else
- - void *res = realloc(ptr,size);
- -#endif
- - DEBUG(3,("Realloc\n"));
- - DEBUG(3,("free called from %s(%d) with ptr=0x%X\n",
- - file,line,
- - (unsigned int)ptr));
- - DEBUG(3,("Malloc called from %s(%d) with size=%d gave ptr=0x%X\n",
- - file,line,
- - size,(unsigned int)res));
- - return(res);
- -}
- -
- -/****************************************************************************
- -wrapper for free() to catch memory errors
- -****************************************************************************/
- -void free_wrapped(void *ptr,char *file,int line)
- -{
- -#ifdef xx_old_free
- - xx_old_free(ptr);
- -#else
- - free(ptr);
- -#endif
- - DEBUG(3,("free called from %s(%d) with ptr=0x%X\n",
- - file,line,(unsigned int)ptr));
- - return;
- -}
- -
- -/* and re-do the define for spots lower in this file */
- -#define malloc(size) malloc_wrapped(size,__FILE__,__LINE__)
- -#define realloc(ptr,size) realloc_wrapped(ptr,size,__FILE__,__LINE__)
- -#define free(ptr) free_wrapped(ptr,__FILE__,__LINE__)
- -
- -#endif
- -
- -#ifdef REPLACE_STRSTR
- -/****************************************************************************
- -Mips version of strstr doesn't seem to work correctly.
- -There is a #define in includes.h to redirect calls to this function.
- -****************************************************************************/
- -char *Strstr(char *s, char *p)
- -{
- - int len = strlen(p);
- -
- - while ( *s != '\0' ) {
- - if ( strncmp(s, p, len) == 0 )
- - return s;
- - s++;
- - }
- -
- - return NULL;
- -}
- -#endif /* REPLACE_STRSTR */
- -
- -
- -#ifdef REPLACE_MKTIME
- -/*******************************************************************
- -a mktime() replacement for those who don't have it - contributed by
- -C.A. Lademann <cal@zls.com>
- -********************************************************************/
- -#define MINUTE 60
- -#define HOUR 60*MINUTE
- -#define DAY 24*HOUR
- -#define YEAR 365*DAY
- -time_t Mktime(struct tm *t)
- -{
- - struct tm *u;
- - time_t epoch = 0;
- - int mon [] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
- - y, m, i;
- -
- - if(t->tm_year < 70)
- - return((time_t)-1);
- -
- - epoch = (t->tm_year - 70) * YEAR +
- - (t->tm_year / 4 - 70 / 4 - t->tm_year / 100) * DAY;
- -
- - y = t->tm_year;
- - m = 0;
- -
- - for(i = 0; i < t->tm_mon; i++) {
- - epoch += mon [m] * DAY;
- - if(m == 1 && y % 4 == 0 && (y % 100 != 0 || y % 400 == 0))
- - epoch += DAY;
- -
- - if(++m > 11) {
- - m = 0;
- - y++;
- - }
- - }
- -
- - epoch += (t->tm_mday - 1) * DAY;
- - epoch += t->tm_hour * HOUR + t->tm_min * MINUTE + t->tm_sec;
- -
- - if((u = localtime(&epoch)) != NULL) {
- - t->tm_sec = u->tm_sec;
- - t->tm_min = u->tm_min;
- - t->tm_hour = u->tm_hour;
- - t->tm_mday = u->tm_mday;
- - t->tm_mon = u->tm_mon;
- - t->tm_year = u->tm_year;
- - t->tm_wday = u->tm_wday;
- - t->tm_yday = u->tm_yday;
- - t->tm_isdst = u->tm_isdst;
- -#ifndef NO_TM_NAME
- - memcpy(t->tm_name, u->tm_name, LTZNMAX);
- -#endif
- - }
- -
- - return(epoch);
- -}
- -#endif /* REPLACE_MKTIME */
- -
- -
- -
- -#ifdef REPLACE_RENAME
- -/* Rename a file. (from libiberty in GNU binutils) */
- - int rename (zfrom, zto)
- - const char *zfrom;
- - const char *zto;
- -{
- - if (link (zfrom, zto) < 0)
- - {
- - if (errno != EEXIST)
- - return -1;
- - if (unlink (zto) < 0
- - || link (zfrom, zto) < 0)
- - return -1;
- - }
- - return unlink (zfrom);
- -}
- -#endif
- -
- -
- -#ifdef REPLACE_INNETGR
- -/*
- - * Search for a match in a netgroup. This replaces it on broken systems.
- - */
- -int InNetGr(char *group,char *host,char *user,char *dom)
- -{
- - char *hst, *usr, *dm;
- -
- - setnetgrent(group);
- - while (getnetgrent(&hst, &usr, &dm))
- - if (((host == 0) || (hst == 0) || !strcmp(host, hst)) &&
- - ((user == 0) || (usr == 0) || !strcmp(user, usr)) &&
- - ((dom == 0) || (dm == 0) || !strcmp(dom, dm))) {
- - endnetgrent();
- - return (1);
- - }
- - endnetgrent();
- - return (0);
- -}
- -#endif
- -
- -
- -#if WRAP_MEMCPY
- -#undef memcpy
- -/*******************************************************************
- -a wrapper around memcpy for diagnostic purposes
- -********************************************************************/
- -void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line)
- -{
- - if (l>64 && (((int)d)%4) != (((int)s)%4))
- - DEBUG(4,("Misaligned memcpy(0x%X,0x%X,%d) at %s(%d)\n",d,s,l,fname,line));
- -#ifdef xx_old_memcpy
- - return(xx_old_memcpy(d,s,l));
- -#else
- - return(memcpy(d,s,l));
- -#endif
- -}
- -#define memcpy(d,s,l) memcpy_wrapped(d,s,l,__FILE__,__LINE__)
- -#endif
-
-
-
- diff -u -r --new-file --exclude=CVS samba-1.9.16alpha9/source/version.h samba-1.9.16alpha10/source/version.h
- --- samba-1.9.16alpha9/source/version.h Sat Jun 8 15:38:39 1996
- +++ samba-1.9.16alpha10/source/version.h Mon Jun 10 15:19:48 1996
- @@ -1 +1 @@
- -#define VERSION "1.9.16alpha9"
- +#define VERSION "1.9.16alpha10"
-